dita-ot / dita-ot

DITA Open Toolkit — the open-source publishing engine for content authored in the Darwin Information Typing Architecture.
https://www.dita-ot.org
Apache License 2.0
403 stars 196 forks source link

PDF Output - Draft comments visible in link text #3271

Open raducoravu opened 5 years ago

raducoravu commented 5 years ago

Tested with latest DITA OT 3.3 trunk code. For example, I have a topic with a section, title and draft-comment:

<section id="section_m3g_pwj_sy">
   <title><draft-comment author="tst">123456789</draft-comment>This is a section title (3)</title>
   <p>T</p>
  </section>

Then in another topic, I add an xref to the above section:

<section id="section_esq_n5q_fhb">
         <p><xref href="topic.dita#concept_lks_kwj_sy/section_m3g_pwj_sy"/>.</p>
 </section>

The PDF output shows the draft comment text inside the link text. The HTML-based output does not have this problem.

raducoravu commented 5 years ago

See places like: "plugins\org.dita.pdf2\xsl\fo\links.xsl":

           <xsl:template match="*[contains(@class, ' topic/section ')][*[contains(@class, ' topic/title ')]]" mode="retrieveReferenceTitle">

Possibly we need to add a new template in the "insert-text" mode which ignored draft-comment, but it should be somehow connected to the parameter:

       <xsl:template match="*[contains(@class, ' topic/draft-comment ')]" mode="insert-text"/>
raducoravu commented 5 years ago

Same problem when having draft-comment in topic titles.

lildebbiedragon commented 5 years ago

Same issue with draft-comments in table/figure titles showing up in List of Tables/Figures (DITA-OT 3.3.3)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not been updated recently. It will be closed soon if no further activity occurs. Thank you for your contributions.

thendarion commented 2 years ago

this issue comes up in LoT/LoF as well when table or figure titles contain draft comments

EDIT: I just realised that lildebbiedragon beat me to it :D

https://github.com/dita-ot/dita-ot/issues/3271#issuecomment-537104267

thendarion commented 2 years ago

anyway, is there a reason for me not to simply add

<xsl:template match="*[contains(@class, ' topic/draft-comment ')]" mode="insert-text"/>

to my XSL stylesheet as a workaround?

raducoravu commented 2 years ago

@thendarion I do not remember this issue too well anymore, there is this "args.draft" parameter which can be enabled for the published output and I do not know how well it works anymore if you add this template which ignores any draft comment.

chrispy-snps commented 2 years ago

Removing draft content is conceptually similar to filtering. If we moved removal to preprocessing, then all transformation targets could inherit the functionality. Perhaps something to consider for DITA-OT 4.0?

(Similarly, I wish preprocessing would remove <draftintro> topics from <bookmap> publishing when args.draft != true; see #3663 for details.)