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

Single Newline Before URLs Not Resulting in Correct Link Rendering #564

Open
csondi10 opened this issue Nov 6, 2023 · 0 comments
Open

Comments

@csondi10
Copy link

csondi10 commented Nov 6, 2023

Environment

  • flutter_markdown package version: 0.6.18
  • Dart SDK version: 3.1.5
  • Flutter version: 3.13.9

Description

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

  1. 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
  2. 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/.
  3. 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.

Expected vs Actual

  • Expected Behavior (Correctly rendered as links):

  • Actual Behavior (URL not rendered as a link):

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant