Unfortunately, HTMLWriter ignores return codes inside attributes. So you need to use other ways to do that.
https://repo.or.cz/docutils.git?a=blame_incremental;hb=28086129e5087833cb8da00b920f92f3f533104f;f=docutils%2Fdocutils%2Fwriters%2F_html_base.py#l228 2019年2月7日(木) 23:47 Chad S <chadsylv...@gmail.com>: > > It's a reference node. The relevant lines are this: > > refnode = nodes.reference('', '', internal=True) > refnode['reftitle'] = title > > Where the variable 'title' is holding the matter that is supposed to include > the line breaks. > > Thanks! > > On Wednesday, February 6, 2019 at 10:47:28 PM UTC-6, Komiya Takeshi wrote: >> >> Hi Chad, >> >> How do you generate <a> tag in your extension? custom node? raw node? >> or other solution? >> The extensions can enhance Sphinx by many ways. So I need to know the >> your strategy. >> >> Thanks, >> Takeshi KOMIYA >> >> 2019年2月7日(木) 7:38 Chad S <chads...@gmail.com>: >> > >> > Hi, >> > >> > Working on an extension for Sphinx 1.6.6. I need to obtain output in html >> > that, among other things, will do something like this in links that get >> > written: >> > >> > <a href="page.html" title="Some text. >> > A second line of text. >> > For clarity, a third."> >> > >> > Yes, ugly, but the tooltip in the browser is lineated and that is >> > meaningful. >> > >> > However, the two pythonic means of putting breaks in strings aren't >> > working. >> > >> > stringval = 'Some text.\r\nA second line of text.\r\nFor clarity, a third' >> > >> > or >> > >> > stringval ='''Some text. >> > A second line of text. >> > For clarity, a third.''' >> > >> > In both cases, the final output is: >> > >> > <a href="age.html" title="Some text. A second line of text. For clarity, a >> > third."> >> > >> > The breaks seem to have been stripped out. >> > >> > Also, attempts to use " ", which are valid for raw html, do not work >> > because Sphinx seems to inflexibly convert any ampersand it finds to >> > "&". So this: >> > >> > stringval='"Some text. A second line of text For clarity, a third.' >> > >> > turns into this: >> > >> > <a href="page.html" title="Some text.&#13;A second line of >> > text.&#13;For clarity, a third."> >> > >> > Any advice on how to get the needed line breaks to the final output? >> > >> > Thanks! >> > >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "sphinx-users" group. >> > To unsubscribe from this group and stop receiving emails from it, send an >> > email to sphinx-users...@googlegroups.com. >> > To post to this group, send email to sphinx...@googlegroups.com. >> > Visit this group at https://groups.google.com/group/sphinx-users. >> > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sphinx-users+unsubscr...@googlegroups.com. > To post to this group, send email to sphinx-users@googlegroups.com. > Visit this group at https://groups.google.com/group/sphinx-users. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users+unsubscr...@googlegroups.com. To post to this group, send email to sphinx-users@googlegroups.com. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.