dita-ot icon indicating copy to clipboard operation
dita-ot copied to clipboard

PDF Output - Draft comments visible in link text

Open raducoravu opened this issue 6 years ago • 8 comments

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 avatar Mar 29 '19 08:03 raducoravu

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 avatar Mar 29 '19 08:03 raducoravu

Same problem when having draft-comment in topic titles.

raducoravu avatar Apr 01 '19 10:04 raducoravu

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

lildebbiedragon avatar Oct 01 '19 15:10 lildebbiedragon

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.

stale[bot] avatar Jan 09 '22 02:01 stale[bot]

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 avatar Mar 02 '22 11:03 thendarion

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?

thendarion avatar Mar 07 '22 09:03 thendarion

@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.

raducoravu avatar Mar 07 '22 09:03 raducoravu

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.)

chrispy-snps avatar Jun 12 '22 12:06 chrispy-snps