The flutter_markdown package, which relies on the markdown package for rendering Markdown content, is not recognizing URLs as links when they are preceded by a single newline. This issue appears to be stemming from the markdown package itself, as the same behavior is observed when Markdown content is rendered on the Dart package's live example site.
Expected Behavior
A URL that follows a single newline should be automatically recognized and rendered as a hyperlink.
Actual Behavior
When there is a single newline before a URL, it is not being rendered as a hyperlink.
Steps to Reproduce
Provide the following Markdown content to be parsed and rendered by the markdown package:
Here is a link, displayed correctly: https://example.com
Here is a link, displayed wrong:
https://example.com
Here is another link after an empty line:
https://example.com
View the rendering result either within a flutter_markdown widget or on the Dart package's live example site at https://dart-lang.github.io/markdown/.
Notice that the second URL (with a single newline before it) is not clickable, while the first and third ones are rendered correctly as a hyperlink.
The inconsistency leads to a worse UX in our app. Of course we could resolve it with workarounds but it would be beneficial for the markdown package to align with the behavior seen on platforms like GitHub and other Markdown previewers.
Thank you for your attention to this matter, and I am looking forward to your response and a resolution.
Environment
flutter_markdown
package version: 0.6.18Description
The
flutter_markdown
package, which relies on themarkdown
package for rendering Markdown content, is not recognizing URLs as links when they are preceded by a single newline. This issue appears to be stemming from themarkdown
package itself, as the same behavior is observed when Markdown content is rendered on the Dart package's live example site.Expected Behavior
A URL that follows a single newline should be automatically recognized and rendered as a hyperlink.
Actual Behavior
When there is a single newline before a URL, it is not being rendered as a hyperlink.
Steps to Reproduce
Provide the following Markdown content to be parsed and rendered by the
markdown
package:flutter_markdown
widget or on the Dart package's live example site at https://dart-lang.github.io/markdown/.Expected vs Actual
Expected Behavior (Correctly rendered as links):
Actual Behavior (URL not rendered as a link):
markdown
package's live example: dart-lang.github.io/markdown.The inconsistency leads to a worse UX in our app. Of course we could resolve it with workarounds but it would be beneficial for the
markdown
package to align with the behavior seen on platforms like GitHub and other Markdown previewers.Thank you for your attention to this matter, and I am looking forward to your response and a resolution.