Skip to content

Commit

Permalink
Fix del, strike and s handle (#1, #2)
Browse files Browse the repository at this point in the history
* Remark.java - add "del", "strike", "s" tags to whitelisting (line 88-89) otherwise these tags are stripped off by the `cleaner`
* DocumentConverter - also add "del,strike,s" tags (on line 88) to inline nodes with `InlineStyle` handler
  • Loading branch information
Guilherme I F L Weizenmann committed Dec 7, 2016
1 parent 44c97a0 commit ff59610
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/overzealous/remark/Remark.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public Remark(Options options) {
"h1", "h2", "h3", "h4", "h5", "h6",
"table", "tbody", "td", "tfoot", "th", "thead", "tr",
"hr",
"span", "font")
"span", "font",
"del", "strike", "s")
.addAttributes("th", "colspan", "align", "style")
.addAttributes("td", "colspan", "align", "style")
.addAttributes(":all", "title", "style");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public DocumentConverter(Options options) {
}

private void configureNodes() {
addInlineNode(new InlineStyle(), "i,em,b,strong,font,span");
addInlineNode(new InlineStyle(), "i,em,b,strong,font,span,del,strike,s");
addInlineNode(new InlineCode(), "code,tt");
addInlineNode(new Image(), "img");
addInlineNode(new Anchor(), "a");
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/conversions/html/unknownHTML.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Division
</div>

<p><foo-bar class="fred">Foo Bar</foo-bar></p>
<p><foo-bar class="foo">Foo Bar</foo-bar></p>

<p><var class="barney"><em>Variable</em></var></p>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Division

<foo-bar class="fred">Foo Bar</foo-bar>
<foo-bar class="foo">Foo Bar</foo-bar>

<var><em>Variable</em></var>

0 comments on commit ff59610

Please sign in to comment.