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

Add support for package:web 1.0.0 #619

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 7.2.3

* Fix an issue with checkbox list items separated with blank lines (#602).
* Require package `web: '>=0.4.2 <2.0.0'`.

## 7.2.2

Expand Down
9 changes: 8 additions & 1 deletion example/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void main() {
void _renderMarkdown([Event? event]) {
final markdown = markdownInput.value;

htmlDiv.innerHTML = md.markdownToHtml(markdown, extensionSet: extensionSet);
htmlDiv.innerHtml = md.markdownToHtml(markdown, extensionSet: extensionSet);

for (final block in htmlDiv.querySelectorAll('pre code').items) {
try {
Expand Down Expand Up @@ -139,3 +139,10 @@ extension on NamedNodeMap {
if (getNamedItem(qualifiedName) != null) removeNamedItem(qualifiedName);
}
}

extension on HTMLDivElement {
// The default implementation allows `JSAny` to support trusted types. We only
// use `String`s, so prefer this to avoid manual conversions.
@JS('innerHTML')
external set innerHtml(String value);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ dev_dependencies:
pool: ^1.5.1
tar: ^1.0.3
test: ^1.16.0
web: '>=0.4.2 <0.6.0'
web: '>=0.4.2 <2.0.0'
yaml: ^3.0.0
Loading