Thanks Takeshi,

It is good to have a definitive answer -- even if it is not the one I was 
hoping for.  Will look for alternatives.  Thanks for tracking that down -- 
I'm sure I would never have found it.

Chad

On Sunday, February 10, 2019 at 5:44:55 AM UTC-6, Komiya Takeshi wrote:
>
> 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 <[email protected] <javascript:>>: 
> > 
> > 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 <[email protected]>: 
> >> > 
> >> > 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 "&#13;", which are valid for raw html, do not 
> work because Sphinx seems to inflexibly convert any ampersand it finds to 
> "&amp;".  So this: 
> >> > 
> >> > stringval='"Some text.&#13;A second line of text&#13;For clarity, a 
> third.' 
> >> > 
> >> > turns into this: 
> >> > 
> >> > <a href="page.html" title="Some text.&amp;#13;A second line of 
> text.&amp;#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 [email protected]. 
> >> > To post to this group, send email to [email protected]. 
> >> > 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 [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to