Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_markdown] Footnote support #5058

Merged
merged 7 commits into from
Oct 4, 2023

Conversation

dawidope
Copy link
Contributor

@dawidope dawidope commented Oct 2, 2023

Support for footnote which was introduced in markdown 7.1.0 which is used in flutter_markdown package.

It allows to use the newest version of markdown without overriding it to 7.0.0 because of missing section tag handling.

Issue: flutter/flutter#127425

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Contributor

@domesticmouse domesticmouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the Linux build failure is sorted

@domesticmouse
Copy link
Contributor

PTAL @tarrinneal

@dawidope
Copy link
Contributor Author

dawidope commented Oct 4, 2023

Hi, I found the issue during adding it to my application. To support superscript the font which is used has to support sups feature. On Android where the default font is Roboto which doesn't support sups nothing changes. So there are two solutions:

  • adding additional parameter to style sheet: superscriptFontFeatureTag which can be set by user, in the case of Roboto we can use numr. It isn't sups because it is aligned to the top of the line (not a few pixels above) but still looks better than normal font
  • replacing font feature by Transform.translate with WidgetSpan.

I have prepared demo with basic implementation. In the case of using custom font feature everything is ready. Using Transform.translate is quite buggy because it doesn't support selectable parameter.

Demo with Roboto font:

image

@domesticmouse domesticmouse merged commit dccde60 into flutter:main Oct 4, 2023
70 checks passed
@tarrinneal
Copy link
Contributor

PTAL @tarrinneal

merged mid review, lol.

no concerns about the comment from @dawidope ?

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 5, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 5, 2023
flutter/packages@d654f75...6714d50

2023-10-04 [email protected] [webview_flutter] Fix XCUITest in Xcode 15 (flutter/packages#5071)
2023-10-04 [email protected] [path_provider] Fix integration tests (flutter/packages#5075)
2023-10-04 [email protected] [flutter_markdown] Footnote support (flutter/packages#5058)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https:/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
flutter/packages@d654f75...6714d50

2023-10-04 [email protected] [webview_flutter] Fix XCUITest in Xcode 15 (flutter/packages#5071)
2023-10-04 [email protected] [path_provider] Fix integration tests (flutter/packages#5075)
2023-10-04 [email protected] [flutter_markdown] Footnote support (flutter/packages#5058)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https:/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
auto-submit bot pushed a commit that referenced this pull request Apr 19, 2024
Fix not solved issue from another PR: #5058 (comment).

I chose the 2nd option with custom font feature.
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
Fix not solved issue from another PR: flutter#5058 (comment).

I chose the 2nd option with custom font feature.
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
Fix not solved issue from another PR: flutter#5058 (comment).

I chose the 2nd option with custom font feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants