Skip to content
Permalink
Browse files

Change strike through to generate line-through and s

  • Loading branch information...
jelovirt committed Oct 4, 2019
1 parent ba3c234 commit 95dec6062d23536736a36c546e2131d87f0d9d7e
@@ -10,6 +10,7 @@
import com.vladsch.flexmark.ext.ins.InsExtension;
import com.vladsch.flexmark.ext.jekyll.tag.JekyllTagExtension;
import com.vladsch.flexmark.ext.tables.TablesExtension;
import com.vladsch.flexmark.ext.typographic.TypographicExtension;
import com.vladsch.flexmark.ext.yaml.front.matter.AbstractYamlFrontMatterVisitor;
import com.vladsch.flexmark.ext.yaml.front.matter.YamlFrontMatterExtension;
import com.vladsch.flexmark.parser.Parser;
@@ -83,6 +83,7 @@
private static final Attributes CODEBLOCK_ATTS = buildAtts(PR_D_CODEBLOCK);
private static final Attributes DT_ATTS = buildAtts(TOPIC_DT);
private static final Attributes DEL_ATTS = new AttributesBuilder().add(ATTRIBUTE_NAME_CLASS, TOPIC_PH.toString()).add("status", "deleted").build();
private static final Attributes LINE_THROUGH_ATTS = buildAtts(HI_D_LINE_THROUGH);
private static final Attributes TITLE_ATTS = buildAtts(TOPIC_TITLE);
private static final Attributes SHORTDESC_ATTS = buildAtts(TOPIC_SHORTDESC);
private static final Attributes PROLOG_ATTS = buildAtts(TOPIC_PROLOG);
@@ -1083,7 +1084,7 @@ private void render(final Link node, final NodeRendererContext context, final Di
// }

private void render(final Strikethrough node, final NodeRendererContext context, final DitaWriter html) {
printTag(node, context, html, TOPIC_PH, DEL_ATTS);
printTag(node, context, html, HI_D_LINE_THROUGH, LINE_THROUGH_ATTS);
}

private void render(final Emphasis node, final NodeRendererContext context, final DitaWriter html) {
@@ -463,6 +463,15 @@
<xsl:template match="del" mode="class">
<xsl:attribute name="class">- topic/ph </xsl:attribute>
</xsl:template>
<xsl:template match="s">
<line-through>
<xsl:apply-templates select="." mode="class"/>
<xsl:apply-templates select="@* | node()"/>
</line-through>
</xsl:template>
<xsl:template match="s" mode="class">
<xsl:attribute name="class">+ topic/ph hi-d/line-through </xsl:attribute>
</xsl:template>
<xsl:template match="code">
<codeph>
<xsl:apply-templates select="." mode="class"/>
@@ -12,6 +12,7 @@
This is a very long line.</p>
<p class="- topic/p ">here is a <b class="+ topic/ph hi-d/b ">bold</b> (<b class="+ topic/ph hi-d/b ">bold</b>) claim</p>
<p class="- topic/p ">here is an <i class="+ topic/ph hi-d/i ">italics</i> (<i class="+ topic/ph hi-d/i ">italics</i>) claim</p>
<p class="- topic/p ">here is <line-through class="+ topic/ph hi-d/line-through ">strike through</line-through> test</p>
<p class="- topic/p ">here is a <codeph class="+ topic/ph pr-d/codeph ">code</codeph> (<codeph class="+ topic/ph pr-d/codeph ">code</codeph>) claim</p>
<p class="- topic/p ">here --- mdash --- dash</p>
<p class="- topic/p ">here -- ndash -- dash</p>
@@ -3,7 +3,7 @@
id="test">
<title class="- topic/title ">Test</title>
<body class="- topic/body ">
<p class="- topic/p ">Paragraph <ph status="deleted" class="- topic/ph ">Text</ph> <i class="+ topic/ph hi-d/i ">test</i> and <b class="+ topic/ph hi-d/b ">list</b>:</p>
<p class="- topic/p ">Paragraph <line-through class="+ topic/ph hi-d/line-through ">Text</line-through> <i class="+ topic/ph hi-d/i ">test</i> and <b class="+ topic/ph hi-d/b ">list</b>:</p>
<ul class="- topic/ul ">
<li class="- topic/li "><p class="- topic/p ">hyphen</p></li>
<li class="- topic/li "><p class="- topic/p ">list</p></li>
@@ -7,6 +7,7 @@ <h1>Test</h1>
<p>This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line. This is a very long line.</p>
<p>here is a <b>bold</b> (<b>bold</b>) claim</p>
<p>here is an <i>italics</i> (<i>italics</i>) claim</p>
<p>here is <s>strike through</s> test</p>
<p>here is a <code>code</code> (<code>code</code>) claim</p>
<p>here --- mdash --- dash</p>
<p>here -- ndash -- dash</p>
@@ -7,7 +7,7 @@
<body>
<article>
<h1 id="test">Test</h1>
<p>Paragraph <del>Text</del> <em>test</em> and <strong>list</strong>:</p>
<p>Paragraph <s>Text</s> <em>test</em> and <strong>list</strong>:</p>
<ul>
<li><p>hyphen</p></li>
<li><p>list</p></li>
@@ -16,8 +16,9 @@
class="+ topic/ph hi-d/b ">bold</b>) claim</p>
<p class="- topic/p ">here is an <i class="+ topic/ph hi-d/i ">italics</i> (<i
class="+ topic/ph hi-d/i ">italics</i>) claim</p>
<p class="- topic/p ">here is <line-through class="+ topic/ph hi-d/line-through ">strike through</line-through> test</p>
<p class="- topic/p ">here is a <codeph class="+ topic/ph pr-d/codeph ">code</codeph> (<codeph
class="+ topic/ph pr-d/codeph ">code</codeph>) claim</p>
class="+ topic/ph pr-d/codeph ">code</codeph>) claim</p>
<p class="- topic/p ">here --- mdash --- dash</p>
<p class="- topic/p ">here -- ndash -- dash</p>
<p class="- topic/p ">HTML <b class="+ topic/ph hi-d/b ">bold</b> element</p>
@@ -4,7 +4,7 @@
domains="(topic hi-d) (topic ut-d) (topic indexing-d) (topic hazard-d) (topic abbrev-d) (topic pr-d) (topic sw-d) (topic ui-d)"
id="test">
<title class="- topic/title ">Test</title>
<shortdesc class="- topic/shortdesc ">Paragraph <ph class="- topic/ph " status="deleted">Text</ph>
<shortdesc class="- topic/shortdesc ">Paragraph <line-through class="+ topic/ph hi-d/line-through ">Text</line-through>
<i class="+ topic/ph hi-d/i ">test</i> and <b class="+ topic/ph hi-d/b ">list</b>:</shortdesc>
<body class="- topic/body ">
<ul class="- topic/ul ">
@@ -9,6 +9,8 @@ here is a **bold** (**bold**) claim

here is an *italics* (*italics*) claim

here is ~~strike through~~ test

here is a `code` (`code`) claim

here --- mdash --- dash

0 comments on commit 95dec60

Please sign in to comment.
You can’t perform that action at this time.