packages icon indicating copy to clipboard operation
packages copied to clipboard

[flutter_markdown] Remove TaskListSyntax and rely on markdown native checkbox support - Fixes https://github.com/flutter/flutter/issues/107871

Open timmaffett opened this issue 2 years ago • 4 comments

Fixes https://github.com/flutter/flutter/issues/107871

Note: This PR relies on the next Markdown to be released, as found in https://github.com/dart-lang/markdown/

This PR

  1. Removes custom TaskListSyntax inline syntax as Markdown now supports checkboxes natively.
  2. Changes the code in _buildCheckbox() slightly to just check for the existence of the 'checked' attribute to determine if a checkbox's state is checked.
  3. Fix the test file list_test.dart to expect the indicatorForCheckedCheckBox and indicatorForUncheckedCheckBox codes to prefix the list item text, as Markdown now inserts these into the text when checkboxes are present.
  4. [Temporary] changes pubspec.yaml to use markdown version from GitHub (temporary until next markdown release to pub.dev).

Pre-launch Checklist

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

timmaffett avatar Jul 20 '22 06:07 timmaffett

PTAL @srawlins

Tim, you have a couple of conflicts due to another PR landing. You'll need to update CHANGELOG.md to accomodate.

domesticmouse avatar Jul 20 '22 22:07 domesticmouse

@domesticmouse I merged into the new changed master and updated this version to be called 0.6.10+4

timmaffett avatar Jul 20 '22 22:07 timmaffett

I'm happy to land this once we have a published version of the markdown package in the pubspec.yaml

domesticmouse avatar Jul 25 '22 02:07 domesticmouse

PTAL @stuartmorgan I believe this is now ready to land

domesticmouse avatar Aug 11 '22 07:08 domesticmouse

Note: the Ordered and Unordered task list item syntaxes are getting a big refactor soon. I don't think it should be breaking, but note just in case: https://github.com/dart-lang/markdown/pull/450

After this lands I plan on cutting markdown 6.0.1

srawlins avatar Aug 30 '22 18:08 srawlins

Can we land this soon (or reformulate the PR and land something like it)? We haven't been able to roll the latest markdown into the dart sdk repo for ~3 months now; I believe we're waiting on this fix landing, this being published, and then the latest markdown and flutter_markdon packages rolling into the sdk simultaneously.

devoncarew avatar Sep 12 '22 16:09 devoncarew