Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit bf65a5f

Browse files
committed
Add support for package:web 1.0.0
1.0.0 modifies innerHTML to be JSAny in order to support trusted types, and this is the only member that needs to be worked around to support that version.
1 parent 6242437 commit bf65a5f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 7.2.3
22

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

56
## 7.2.2
67

example/app.dart

+8-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void main() {
6969
void _renderMarkdown([Event? event]) {
7070
final markdown = markdownInput.value;
7171

72-
htmlDiv.innerHTML = md.markdownToHtml(markdown, extensionSet: extensionSet);
72+
htmlDiv.innerHtml = md.markdownToHtml(markdown, extensionSet: extensionSet);
7373

7474
for (final block in htmlDiv.querySelectorAll('pre code').items) {
7575
try {
@@ -139,3 +139,10 @@ extension on NamedNodeMap {
139139
if (getNamedItem(qualifiedName) != null) removeNamedItem(qualifiedName);
140140
}
141141
}
142+
143+
extension on HTMLDivElement {
144+
// The default implementation allows `JSAny` to support trusted types. We only
145+
// use `String`s, so prefer this to avoid manual conversions.
146+
@JS('innerHTML')
147+
external set innerHtml(String value);
148+
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ dev_dependencies:
3030
pool: ^1.5.1
3131
tar: ^1.0.3
3232
test: ^1.16.0
33-
web: '>=0.4.2 <0.6.0'
33+
web: '>=0.4.2 <2.0.0'
3434
yaml: ^3.0.0

0 commit comments

Comments
 (0)