Skip to content

feat: Add support for strike-through text for flame_markdown#3426

Merged
luanpotter merged 1 commit intomainfrom
luan.strike
Dec 29, 2024
Merged

feat: Add support for strike-through text for flame_markdown#3426
luanpotter merged 1 commit intomainfrom
luan.strike

Conversation

@luanpotter
Copy link
Copy Markdown
Member

@luanpotter luanpotter commented Dec 29, 2024

Description

image

Add support for strike-through text for flame_markdown, if enabled by the user.

Basically parses the del HTMl tag and maps it to a new inline text renderer in Flame's text rendering pipeline.

The style can be controlled with a new property if desired.

In order to parse ~~-wrapped text into the new node element, the underlying markdown parser must have the strikethrough option enabled (or an equivalent custom option), which can be controlled by the user if providing their own document.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

@luanpotter luanpotter force-pushed the luan.strike branch 2 times, most recently from 22b3147 to bd03bc7 Compare December 29, 2024 03:04
@luanpotter
Copy link
Copy Markdown
Member Author

Note: according to Wikipedia, "Strikethrough" is correct as a single word so I added to the dictionary but happy to rename everything to "Strike Through" if that is preferred.

flame_markdown: ^0.2.2+3
flutter:
sdk: flutter
markdown: ^7.1.1
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

note: in order to provide custom documents, a user would need to add this as a direct dependency. another option is that we export all the relevant classes on flame_markdown; not sure what would be the best practice here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If there aren't that many I think we should export them

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

let me make a followup as a proposal and we can assess together - sadly I think there is quite a few

@luanpotter luanpotter merged commit 1f9b0ea into main Dec 29, 2024
@luanpotter luanpotter deleted the luan.strike branch December 29, 2024 15:52
nickf2k pushed a commit to nickf2k/flame that referenced this pull request Nov 16, 2025
…ngine#3426)

Add support for strike-through text for flame_markdown, if enabled by
the user.

Basically parses the `del` HTMl tag and maps it to a new inline text
renderer in Flame's text rendering pipeline.

The style can be controlled with a new property if desired.

In order to parse `~~`-wrapped text into the new node element, the
underlying markdown parser must have the strikethrough option enabled
(or an equivalent custom option), which can be controlled by the user if
providing their own document.
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

Successfully merging this pull request may close these issues.

2 participants