New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid content generated by filtered elements #2701 #2712

Merged
merged 3 commits into from Jun 5, 2017
Jump to file or symbol
Failed to load files and symbols.
+21 −0
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Fix invalid XHTML generated by filtered-out content #2701

Signed-off-by: Robert D Anderson <robander@us.ibm.com>
  • Loading branch information...
robander committed May 31, 2017
commit 58813d4861ac70e54bc2da287c7e3c5a1c73c2ee
@@ -742,6 +742,11 @@ See the accompanying LICENSE file for applicable license.
<!-- =========== SINGLE PART LISTS =========== -->
<!-- Ignore empty lists with all content filtered out -->
<xsl:template match="*[contains(@class, ' topic/ol ')][empty(*[contains(@class,' topic/li ')])]" priority="10"/>
<xsl:template match="*[contains(@class, ' topic/ul ')][empty(*[contains(@class,' topic/li ')])]" priority="10"/>
<xsl:template match="*[contains(@class, ' topic/sl ')][empty(*[contains(@class,' topic/sli ')])]" priority="10"/>
<!-- Unordered List -->
<!-- handle all levels thru browser processing -->
@@ -869,6 +874,8 @@ See the accompanying LICENSE file for applicable license.
<!-- =========== DEFINITION LIST =========== -->
<!-- DL -->
<xsl:template match="*[contains(@class,' topic/dl ')][empty(*[contains(@class,' topic/dlentry ')])]" priority="10"/>
<xsl:template match="*[contains(@class, ' topic/dl ')]" name="topic.dl">
<xsl:call-template name="setaname"/>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
@@ -27,6 +27,11 @@ See the accompanying LICENSE file for applicable license.
<!-- Override this to use a local convention for setting table's @summary attribute,
until OASIS provides a standard mechanism for setting. -->
</xsl:template>
<xsl:template match="*[contains(@class,' topic/table ')]
[empty(*[contains(@class,' topic/tgroup ')]/*[contains(@class,' topic/tbody ')]/*[contains(@class,' topic/row ')])]" priority="10"/>
<xsl:template match="*[contains(@class,' topic/tgroup ')]
[empty(*[contains(@class,' topic/tbody ')]/*[contains(@class,' topic/row ')])]" priority="10"/>
<xsl:template match="*[contains(@class, ' topic/table ')]" name="topic.table">
<xsl:value-of select="$newline"/>
@@ -681,6 +686,11 @@ See the accompanying LICENSE file for applicable license.
</xsl:template>
<!-- =========== SimpleTable - SEMANTIC TABLE =========== -->
<xsl:template match="*[contains(@class,' topic/simpletable ')]
[empty(*[contains(@class,' topic/strow ')]/*[contains(@class,' topic/stentry ')])]" priority="10"/>
<xsl:template match="*[contains(@class,' topic/strow ') or contains(@class,' topic/sthead ')][empty(*[contains(@class,' topic/stentry ')])]" priority="10"/>
<xsl:template match="*[contains(@class, ' topic/simpletable ')]" mode="generate-table-summary-attribute">
<!-- Override this to use a local convention for setting table's @summary attribute,
@@ -315,6 +315,8 @@ See the accompanying LICENSE file for applicable license.
</xsl:template>
<!-- nested steps - 1 level of nesting only -->
<xsl:template match="*[contains(@class, ' task/substeps ')][empty(*[contains(@class,' task/substep ')])]" priority="10"/>
<xsl:template match="*[contains(@class,' task/substeps ')]" name="topic.task.substeps">
<!-- If there's a block element somewhere in the step list, expand the whole list -->
<xsl:variable name="sub_step_expand"> <!-- set & save sub_step_expand=yes/no for expanding/compacting list items -->
@@ -353,6 +355,8 @@ See the accompanying LICENSE file for applicable license.
</xsl:template>
<!-- choices contain choice items -->
<xsl:template match="*[contains(@class, ' task/choices ')][empty(*[contains(@class,' task/choice ')])]" priority="10"/>
<xsl:template match="*[contains(@class,' task/choices ')]" name="topic.task.choices">
<xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="setaname"/>
ProTip! Use n and p to navigate between commits in a pull request.