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

fix: fix checkbox not work as expected in html module. #700

Merged
merged 9 commits into from
Feb 1, 2024

Conversation

penkzhou
Copy link
Contributor

@penkzhou penkzhou commented Jan 31, 2024

First, let me describe how the bug was discovered. I was using this lib to export Markdown to PDF. The library first renders the Markdown in an editor on the page by calling the markdownToDocument method. It then converts the rendered document to HTML code via the documentToHtml method. Finally, it exports the generated HTML into a PDF file.

To visualize the steps, here are some screenshots:

editor ui bug export to pdf normal export to pdf

bug cause

according the MDN docs, checkbox should write like this:

checked checkbox

<input type="checkbox" id="scales" name="scales" checked /> <label for="scales">Scales</label>

non check checkbox(without checked attribute)

<input type="checkbox" id="scales" name="scales" /> <label for="scales">Scales</label>

how to fix it

change the code in the todo_list_node_parser.dart file. main change include following points:

  1. change the insert position of input tag to keep checkbox in the first of the line.
  2. change the way of setting checkbox's checked attribute.

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e80edfc) 75.50% compared to head (7f7335a) 75.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #700   +/-   ##
=======================================
  Coverage   75.50%   75.50%           
=======================================
  Files         296      296           
  Lines       13630    13630           
=======================================
  Hits        10291    10291           
  Misses       3339     3339           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LucasXu0
Copy link
Collaborator

LucasXu0 commented Feb 1, 2024

LGTM.

@LucasXu0 LucasXu0 merged commit 3679647 into AppFlowy-IO:main Feb 1, 2024
9 of 10 checks passed
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Feb 19, 2024
* main:
  chore: upgrade flutter version to 3.19.0 (AppFlowy-IO#719)
  fix: the positioning of the slash command menu in the web version (AppFlowy-IO#709)
  fix: unable to export image block in markdown format (AppFlowy-IO#713)
  feat: debounce on word count service (AppFlowy-IO#711)
  feat: on demand word count without listening (AppFlowy-IO#710)
  feat: support selection counters (AppFlowy-IO#706)
  feat: word counter service (AppFlowy-IO#705)
  chore: bump version 2.3.2
  chore: update Chinese i18n (AppFlowy-IO#698)
  fix: fix checkbox not work as expected in html module. (AppFlowy-IO#700)
  chore: revert ime changes (AppFlowy-IO#701)
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