Closed BoykoAlex closed 7 years ago
According to W3C specs (https://www.w3.org/TR/html5/edits.html#edits-and-paragraphs) del
can contain paragraphs. Maybe that explain why jsoup sets it as block. I'll try to look that later. Thanks for PR.
Hi @BoykoAlex
I've looking on your first commit in this PR. It was almost ok, I made a few adjusts on tests and in the inline style rules to add a space if del
is the block inlined. Please take a look on the commit 44c97a0 (branch BoykoAlex-strike-through) to check if its working as you expect. If its OK, just tel me and I'll pack a new version.
Thanks
I have tried BoykoAlex-strike-through
branch think it's missing a few changes from that first commit of mine.
I'm trying to have the following test to work:
HTML: <p>Contains <del>strike through</del> text</p>
Becomes markdown: Contains ~~strike through~~ text
It's working perfectly if those missing changes are in with your changes for the white space. Missing changes are simple:
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
handlerI think it's done. Just give-me an OK and I publish it in JCenter.
@giflw looks good!-) Thanks very much!-)
Closed by #2
Published at:
<dependency>
<groupId>com.overzealous</groupId>
<artifactId>remark</artifactId>
<version>1.1.0</version>
</dependency>
Support for strike through HTML:
<span style="text-decoration: line-through;">
There is HTML<del>
element, but adding support for it is problematic because JSoup has it as block element instead of inlineHTML:
<p>Contains <del>strike through</del> text</p>
Becomes markdown:Contains~~strike through~~text
(no spaces, becausedel
is block tag)