Skip to content

Commit 1982844

Browse files
committed
markdown document preview improvements
Closes #6652 - hardcoded swing html renderer compatible css styling - custom <hr> tag renderer - strikethrough extension - uniform mime_type - update vscode regex for striketrhough detection
1 parent ac407de commit 1982844

10 files changed

Lines changed: 191 additions & 40 deletions

File tree

ide/libs.flexmark/external/binaries-list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ A3F92ABD0ACBB4D1F12DFD3D6128F73D245D6BA9 com.vladsch.flexmark:flexmark-util-data
3030
985913246DF64FE7E768EB0664B45DEDEA7536CF com.vladsch.flexmark:flexmark-util-sequence:0.64.8
3131
A8178BA6DFD7A958353A60B3A51FE7EDB1578B49 com.vladsch.flexmark:flexmark-util-visitor:0.64.8
3232
4ADC75ADA3D870908BDBFFB76650D19305250D3C com.vladsch.flexmark:flexmark-ext-gfm-tasklist:0.64.8
33+
1851E124C6D85C5C7F3FDBBE066D30A76AD6BE44 com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.64.8
3334
CD56EB47DCD4590EF6451F87E5EC33BDDD1A9A51 org.jsoup:jsoup:1.15.4

ide/libs.flexmark/manifest.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
22
AutoUpdate-Show-In-Client: true
33
OpenIDE-Module: org.netbeans.libs.flexmark
44
OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/flexmark/Bundle.properties
5-
OpenIDE-Module-Specification-Version: 1.25
5+
OpenIDE-Module-Specification-Version: 1.26
66

ide/libs.flexmark/nbproject/project.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
file.reference.flexmark-0.64.8.jar=external/flexmark-0.64.8.jar
19+
file.reference.flexmark-ext-anchorlink-0.64.8.jar=external/flexmark-ext-anchorlink-0.64.8.jar
20+
file.reference.flexmark-ext-emoji-0.64.8.jar=external/flexmark-ext-emoji-0.64.8.jar
21+
file.reference.flexmark-ext-gfm-tasklist-0.64.8.jar=external/flexmark-ext-gfm-tasklist-0.64.8.jar
22+
file.reference.flexmark-ext-tables-0.64.8.jar=external/flexmark-ext-tables-0.64.8.jar
23+
file.reference.flexmark-html2md-converter-0.64.8.jar=external/flexmark-html2md-converter-0.64.8.jar
24+
file.reference.flexmark-util-ast-0.64.8.jar=external/flexmark-util-ast-0.64.8.jar
25+
file.reference.flexmark-util-builder-0.64.8.jar=external/flexmark-util-builder-0.64.8.jar
26+
file.reference.flexmark-util-collection-0.64.8.jar=external/flexmark-util-collection-0.64.8.jar
27+
file.reference.flexmark-util-data-0.64.8.jar=external/flexmark-util-data-0.64.8.jar
28+
file.reference.flexmark-util-dependency-0.64.8.jar=external/flexmark-util-dependency-0.64.8.jar
29+
file.reference.flexmark-util-format-0.64.8.jar=external/flexmark-util-format-0.64.8.jar
30+
file.reference.flexmark-util-html-0.64.8.jar=external/flexmark-util-html-0.64.8.jar
31+
file.reference.flexmark-util-misc-0.64.8.jar=external/flexmark-util-misc-0.64.8.jar
32+
file.reference.flexmark-util-sequence-0.64.8.jar=external/flexmark-util-sequence-0.64.8.jar
33+
file.reference.flexmark-util-visitor-0.64.8.jar=external/flexmark-util-visitor-0.64.8.jar
34+
file.reference.jsoup-1.15.4.jar=external/jsoup-1.15.4.jar
1835
javac.release=11
1936
javac.compilerargs=-Xlint -Xlint:-serial
2037
release.external/flexmark-0.64.8.jar=modules/ext/flexmark-0.64.8.jar
@@ -33,6 +50,7 @@ release.external/flexmark-ext-emoji-0.64.8.jar=modules/ext/flexmark-ext-emoji-0.
3350
release.external/flexmark-ext-anchorlink-0.64.8.jar=modules/ext/flexmark-ext-anchorlink-0.64.8.jar
3451
release.external/flexmark-ext-tables-0.64.8.jar=modules/ext/flexmark-ext-tables-0.64.8.jar
3552
release.external/flexmark-ext-gfm-tasklist-0.64.8.jar=modules/ext/flexmark-ext-gfm-tasklist-0.64.8.jar
53+
release.external/flexmark-ext-gfm-strikethrough-0.64.8.jar=modules/ext/flexmark-ext-gfm-strikethrough-0.64.8.jar
3654
release.external/jsoup-1.15.4.jar=modules/ext/jsoup-1.15.4.jar
3755

3856
# Sigtest seems to have issues with some Java 11 class files, better to disable it.

ide/libs.flexmark/nbproject/project.xml

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,72 +30,76 @@
3030
<subpackages>org.jsoup</subpackages>
3131
</public-packages>
3232
<class-path-extension>
33-
<runtime-relative-path>ext/flexmark-html2md-converter-0.64.8.jar</runtime-relative-path>
34-
<binary-origin>external/flexmark-html2md-converter-0.64.8.jar</binary-origin>
35-
</class-path-extension>
36-
<class-path-extension>
37-
<runtime-relative-path>ext/jsoup-1.15.4.jar</runtime-relative-path>
38-
<binary-origin>external/jsoup-1.15.4.jar</binary-origin>
39-
</class-path-extension>
40-
<class-path-extension>
41-
<runtime-relative-path>ext/flexmark-util-ast-0.64.8.jar</runtime-relative-path>
42-
<binary-origin>external/flexmark-util-ast-0.64.8.jar</binary-origin>
33+
<runtime-relative-path>ext/flexmark-util-misc-0.64.8.jar</runtime-relative-path>
34+
<binary-origin>external/flexmark-util-misc-0.64.8.jar</binary-origin>
4335
</class-path-extension>
4436
<class-path-extension>
45-
<runtime-relative-path>ext/flexmark-util-builder-0.64.8.jar</runtime-relative-path>
46-
<binary-origin>external/flexmark-util-builder-0.64.8.jar</binary-origin>
37+
<runtime-relative-path>ext/flexmark-util-dependency-0.64.8.jar</runtime-relative-path>
38+
<binary-origin>external/flexmark-util-dependency-0.64.8.jar</binary-origin>
4739
</class-path-extension>
4840
<class-path-extension>
49-
<runtime-relative-path>ext/flexmark-util-collection-0.64.8.jar</runtime-relative-path>
50-
<binary-origin>external/flexmark-util-collection-0.64.8.jar</binary-origin>
41+
<runtime-relative-path>ext/flexmark-util-visitor-0.64.8.jar</runtime-relative-path>
42+
<binary-origin>external/flexmark-util-visitor-0.64.8.jar</binary-origin>
5143
</class-path-extension>
5244
<class-path-extension>
53-
<runtime-relative-path>ext/flexmark-util-data-0.64.8.jar</runtime-relative-path>
54-
<binary-origin>external/flexmark-util-data-0.64.8.jar</binary-origin>
45+
<runtime-relative-path>ext/flexmark-ext-anchorlink-0.64.8.jar</runtime-relative-path>
46+
<binary-origin>external/flexmark-ext-anchorlink-0.64.8.jar</binary-origin>
5547
</class-path-extension>
5648
<class-path-extension>
57-
<runtime-relative-path>ext/flexmark-util-dependency-0.64.8.jar</runtime-relative-path>
58-
<binary-origin>external/flexmark-util-dependency-0.64.8.jar</binary-origin>
49+
<runtime-relative-path>ext/flexmark-ext-gfm-tasklist-0.64.8.jar</runtime-relative-path>
50+
<binary-origin>external/flexmark-ext-gfm-tasklist-0.64.8.jar</binary-origin>
5951
</class-path-extension>
6052
<class-path-extension>
61-
<runtime-relative-path>ext/flexmark-util-format-0.64.8.jar</runtime-relative-path>
62-
<binary-origin>external/flexmark-util-format-0.64.8.jar</binary-origin>
53+
<runtime-relative-path>ext/flexmark-util-builder-0.64.8.jar</runtime-relative-path>
54+
<binary-origin>external/flexmark-util-builder-0.64.8.jar</binary-origin>
6355
</class-path-extension>
6456
<class-path-extension>
6557
<runtime-relative-path>ext/flexmark-util-html-0.64.8.jar</runtime-relative-path>
6658
<binary-origin>external/flexmark-util-html-0.64.8.jar</binary-origin>
6759
</class-path-extension>
6860
<class-path-extension>
69-
<runtime-relative-path>ext/flexmark-util-misc-0.64.8.jar</runtime-relative-path>
70-
<binary-origin>external/flexmark-util-misc-0.64.8.jar</binary-origin>
61+
<runtime-relative-path>ext/jsoup-1.15.4.jar</runtime-relative-path>
62+
<binary-origin>external/jsoup-1.15.4.jar</binary-origin>
7163
</class-path-extension>
7264
<class-path-extension>
73-
<runtime-relative-path>ext/flexmark-util-sequence-0.64.8.jar</runtime-relative-path>
74-
<binary-origin>external/flexmark-util-sequence-0.64.8.jar</binary-origin>
65+
<runtime-relative-path>ext/flexmark-util-format-0.64.8.jar</runtime-relative-path>
66+
<binary-origin>external/flexmark-util-format-0.64.8.jar</binary-origin>
7567
</class-path-extension>
7668
<class-path-extension>
77-
<runtime-relative-path>ext/flexmark-util-visitor-0.64.8.jar</runtime-relative-path>
78-
<binary-origin>external/flexmark-util-visitor-0.64.8.jar</binary-origin>
69+
<runtime-relative-path>ext/flexmark-html2md-converter-0.64.8.jar</runtime-relative-path>
70+
<binary-origin>external/flexmark-html2md-converter-0.64.8.jar</binary-origin>
7971
</class-path-extension>
8072
<class-path-extension>
8173
<runtime-relative-path>ext/flexmark-ext-emoji-0.64.8.jar</runtime-relative-path>
8274
<binary-origin>external/flexmark-ext-emoji-0.64.8.jar</binary-origin>
8375
</class-path-extension>
8476
<class-path-extension>
85-
<runtime-relative-path>ext/flexmark-ext-anchorlink-0.64.8.jar</runtime-relative-path>
86-
<binary-origin>external/flexmark-ext-anchorlink-0.64.8.jar</binary-origin>
77+
<runtime-relative-path>ext/flexmark-0.64.8.jar</runtime-relative-path>
78+
<binary-origin>external/flexmark-0.64.8.jar</binary-origin>
79+
</class-path-extension>
80+
<class-path-extension>
81+
<runtime-relative-path>ext/flexmark-util-ast-0.64.8.jar</runtime-relative-path>
82+
<binary-origin>external/flexmark-util-ast-0.64.8.jar</binary-origin>
83+
</class-path-extension>
84+
<class-path-extension>
85+
<runtime-relative-path>ext/flexmark-util-data-0.64.8.jar</runtime-relative-path>
86+
<binary-origin>external/flexmark-util-data-0.64.8.jar</binary-origin>
8787
</class-path-extension>
8888
<class-path-extension>
8989
<runtime-relative-path>ext/flexmark-ext-tables-0.64.8.jar</runtime-relative-path>
9090
<binary-origin>external/flexmark-ext-tables-0.64.8.jar</binary-origin>
9191
</class-path-extension>
9292
<class-path-extension>
93-
<runtime-relative-path>ext/flexmark-0.64.8.jar</runtime-relative-path>
94-
<binary-origin>external/flexmark-0.64.8.jar</binary-origin>
93+
<runtime-relative-path>ext/flexmark-util-collection-0.64.8.jar</runtime-relative-path>
94+
<binary-origin>external/flexmark-util-collection-0.64.8.jar</binary-origin>
9595
</class-path-extension>
9696
<class-path-extension>
97-
<runtime-relative-path>ext/flexmark-ext-gfm-tasklist-0.64.8.jar</runtime-relative-path>
98-
<binary-origin>external/flexmark-ext-gfm-tasklist-0.64.8.jar</binary-origin>
97+
<runtime-relative-path>ext/flexmark-util-sequence-0.64.8.jar</runtime-relative-path>
98+
<binary-origin>external/flexmark-util-sequence-0.64.8.jar</binary-origin>
99+
</class-path-extension>
100+
<class-path-extension>
101+
<runtime-relative-path>ext/flexmark-ext-gfm-strikethrough-0.64.8.jar</runtime-relative-path>
102+
<binary-origin>external/flexmark-ext-gfm-strikethrough-0.64.8.jar</binary-origin>
99103
</class-path-extension>
100104
</data>
101105
</configuration>

ide/markdown/src/org/netbeans/modules/markdown/MarkdownDataObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@
105105
@GrammarRegistration(mimeType=MarkdownDataObject.MIME_TYPE, grammar="markdown.tmLanguage.json")
106106
public class MarkdownDataObject extends MultiDataObject {
107107

108-
public static final String MIME_TYPE = "text/x-markdown-nb";
108+
public static final String MIME_TYPE = "text/x-markdown";
109109

110110
public MarkdownDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
111111
super(pf, loader);
112-
registerEditor("text/x-markdown", true);
112+
registerEditor(MIME_TYPE, true);
113113
}
114114

115115
@Override

ide/markdown/src/org/netbeans/modules/markdown/MarkdownViewerElement.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.netbeans.modules.markdown;
2020

2121
import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension;
22+
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
2223
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
2324
import com.vladsch.flexmark.ext.tables.TablesExtension;
2425
import com.vladsch.flexmark.html.HtmlRenderer;
@@ -49,6 +50,7 @@
4950
import org.netbeans.core.spi.multiview.CloseOperationState;
5051
import org.netbeans.core.spi.multiview.MultiViewElement;
5152
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
53+
import static org.netbeans.modules.markdown.MarkdownDataObject.MIME_TYPE;
5254
import org.netbeans.modules.markdown.ui.preview.MarkdownEditorKit;
5355
import org.openide.awt.HtmlBrowser;
5456
import org.openide.awt.UndoRedo;
@@ -71,7 +73,7 @@
7173
@MultiViewElement.Registration(
7274
displayName = "#LBL_MarkdownViewer",
7375
iconBase = "org/netbeans/modules/markdown/markdown.png",
74-
mimeType = "text/x-markdown",
76+
mimeType = MIME_TYPE,
7577
persistenceType = TopComponent.PERSISTENCE_NEVER,
7678
preferredID = "MarkdownViewer",
7779
position = 2000
@@ -94,7 +96,8 @@ public class MarkdownViewerElement implements MultiViewElement {
9496
.set(Parser.EXTENSIONS, Arrays.asList(
9597
AnchorLinkExtension.create(),
9698
TablesExtension.create(),
97-
TaskListExtension.create()
99+
TaskListExtension.create(),
100+
StrikethroughExtension.create()
98101
))
99102
.set(HtmlRenderer.INDENT_SIZE, 2)
100103
.set(HtmlRenderer.RENDER_HEADER_ID, true)
@@ -111,6 +114,9 @@ public class MarkdownViewerElement implements MultiViewElement {
111114
.set(TablesExtension.APPEND_MISSING_COLUMNS, true)
112115
.set(TablesExtension.DISCARD_EXTRA_COLUMNS, true)
113116
.set(TablesExtension.HEADER_SEPARATOR_COLUMN_MATCH, true)
117+
// Strikethrough change from del to s tag
118+
.set(StrikethroughExtension.STRIKETHROUGH_STYLE_HTML_OPEN, "<s>")
119+
.set(StrikethroughExtension.STRIKETHROUGH_STYLE_HTML_CLOSE, "</s>")
114120
.toImmutable();
115121

116122
final Parser parser = Parser.builder(OPTIONS).build();

ide/markdown/src/org/netbeans/modules/markdown/markdown.tmLanguage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
55
"Once accepted there, we are happy to receive an update request."
66
],
7-
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/7418dd20d76c72e82fadee2909e03239e9973b35",
7+
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/548ccb91ef58ba40ac745b400d889933ccd5eb4d",
88
"name": "Markdown",
99
"scopeName": "text.html.markdown",
1010
"patterns": [
@@ -3084,7 +3084,7 @@
30843084
"name": "punctuation.definition.strikethrough.markdown"
30853085
}
30863086
},
3087-
"match": "(?<!\\\\)(~{2,})((?:[^~]|(?!(?<![~\\\\])\\1(?!~))~)*+)(\\1)",
3087+
"match": "(?<!\\\\)(~{2,})(?!(?<=\\w~~)_)((?:[^~]|(?!(?<![~\\\\])\\1(?!~))~)*+)(\\1)(?!(<=_\\1)\\w)",
30883088
"name": "markup.strikethrough.markdown"
30893089
}
30903090
}

ide/markdown/src/org/netbeans/modules/markdown/ui/preview/MarkdownEditorKit.java

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
*/
1919
package org.netbeans.modules.markdown.ui.preview;
2020

21+
import javax.swing.text.Document;
2122
import org.netbeans.modules.markdown.ui.preview.views.MarkdownViewFactory;
2223
import javax.swing.text.ViewFactory;
24+
import javax.swing.text.html.HTMLDocument;
2325
import javax.swing.text.html.HTMLEditorKit;
26+
import javax.swing.text.html.StyleSheet;
2427

2528
/**
2629
*
@@ -29,14 +32,76 @@
2932
public class MarkdownEditorKit extends HTMLEditorKit {
3033

3134
private final transient ViewFactory viewFactory;
32-
35+
3336
public MarkdownEditorKit() {
3437
super();
3538
this.viewFactory = new MarkdownViewFactory();
3639
}
3740

41+
/**
42+
* copy/paste from the original HTMLEditorKit method but with custom styling overriding
43+
* @see HTMLEditorKit.createDefaultDocument
44+
*
45+
* @return
46+
*/
47+
@Override
48+
public Document createDefaultDocument() {
49+
StyleSheet styles = getStyleSheet();
50+
StyleSheet ss = new StyleSheet();
51+
52+
//default style override
53+
ss.addStyleSheet(styles);
54+
addCustomStyleRules(ss);
55+
56+
HTMLDocument doc = new HTMLDocument(ss);
57+
doc.setParser(getParser());
58+
doc.setAsynchronousLoadPriority(4);
59+
doc.setTokenThreshold(100);
60+
return doc;
61+
}
62+
3863
@Override
3964
public ViewFactory getViewFactory() {
4065
return viewFactory;
4166
}
67+
68+
/**
69+
* Hardcoded styling customization asa a quick fix for improving
70+
* dispaly of markdown previews
71+
*
72+
* Note some css rules are not recognized in Swing
73+
*
74+
* Existing swing html CSS limitations
75+
* - hr no styling
76+
* - code element no padding
77+
* - table no border collapse
78+
* - no nth-child selector
79+
*
80+
* @param ss
81+
*/
82+
private void addCustomStyleRules(StyleSheet ss) {
83+
//body
84+
ss.addRule("body {padding:40px;background-color:white}"); // NOI18N
85+
//headings
86+
ss.addRule("h1 a, h2 a, h3 a, h4 a, h5 a, h6 a{color:black;}"); // NOI18N
87+
ss.addRule("h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {font-size:inherit;}"); // NOI18N
88+
//list
89+
ss.addRule("ul, li ul {margin-left: 20px;}"); // NOI18N
90+
ss.addRule("li {margin-bottom: 3px;padding-left:5px;}"); // NOI18N
91+
92+
//table
93+
ss.addRule("table {border-spacing:0;}"); // NOI18N
94+
ss.addRule("th, td {border:1px solid rgb(209, 217, 224); padding:10px;}"); // NOI18N
95+
96+
//code related styling
97+
ss.addRule("code {border-radius: 6px; background-color: rgba(129, 139, 152, 0.12);}"); // NOI18N
98+
ss.addRule("pre {padding:16px; background-color: rgb(246, 248, 250);}"); // NOI18N
99+
ss.addRule("pre code {border-radius:0px; background-color:rgb(246, 248, 250);}");
100+
101+
//blockquote
102+
ss.addRule("blockquote {padding: 0 16px; margin: 0px; border-left: 2px solid rgb(209, 217, 224);}"); // NOI18N
103+
ss.addRule("blockquote p { color:rgb(89, 99, 110);}"); // NOI18N
104+
ss.addRule("pre, blockquote {margin-bottom: 10px;}"); // NOI18N
105+
ss.addRule("li blockquote {margin-bottom: 0px;}"); // NOI18N
106+
}
42107
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.netbeans.modules.markdown.ui.preview.views;
20+
21+
import java.awt.Color;
22+
import java.awt.Component;
23+
import java.awt.GridLayout;
24+
import javax.swing.BorderFactory;
25+
import javax.swing.JPanel;
26+
import javax.swing.JSeparator;
27+
import javax.swing.border.EmptyBorder;
28+
import javax.swing.text.ComponentView;
29+
import javax.swing.text.Element;
30+
31+
/**
32+
*
33+
* hr tags don't have any customization from CSS using swing html renderer
34+
*
35+
* Render patch to have controlled display
36+
*/
37+
public class HorizontalRuleView extends ComponentView {
38+
39+
public HorizontalRuleView(Element elem) {
40+
super(elem);
41+
}
42+
43+
@Override
44+
protected Component createComponent() {
45+
JPanel panel = new JPanel();
46+
panel.setOpaque(false);
47+
JSeparator component = new JSeparator();
48+
component.setOrientation(HORIZONTAL);
49+
component.setBorder(BorderFactory.createLineBorder(new Color(209, 217, 224), 2));
50+
panel.add(component);
51+
panel.setBorder(new EmptyBorder(20, 0, 20, 0));
52+
panel.setLayout(new GridLayout(0,1));
53+
return panel;
54+
}
55+
}

ide/markdown/src/org/netbeans/modules/markdown/ui/preview/views/MarkdownViewFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public View create(Element elem) {
4141

4242
if (isElementOfTag(elem, HTML.Tag.INPUT)) {
4343
return new CheckboxView(elem);
44+
} else if (isElementOfTag(elem, HTML.Tag.HR)) {
45+
return new HorizontalRuleView(elem);
4446
}
4547

4648
return super.create(elem);

0 commit comments

Comments
 (0)