The patch seems to work in Debian 11 bullseye but we have remaining errors while trying to build the debian handbook in Debian Unstable. Not sure if it's related or if it's something entirely different. cf feedback received in https://salsa.debian.org/hertzog/debian-handbook/-/issues/49#note_302033
Fails to produce PDF output when using scale.by.width - produces broken lstlisting/lstcode options
I'm not sure that this is correct. Neither code nor literal are verbatim elements according to the Docbook specification (they are both "inline"). So multiple spaces are not necessarily intended. Also consider what line wrapping might have as consequences with your change: <para> Consider the value <literal>one two</literal>... how many spaces should it contain? </para>
This bug is also tracked on the Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862332 It contains a minimal test case here: XML: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=862332;filename=test.xml;msg=15 PDF: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=862332;filename=test.pdf;msg=15 It would be nice to get this bug fixed in an official dblatex release.
The full patch for clarity: --- a/lib/dbtexmf/dblatex/texhyphen.py +++ b/lib/dbtexmf/dblatex/texhyphen.py @@ -49,7 +49,7 @@ class UrlHyphenator(Hyphenator): existing latex styles. """ def __init__(self, codec=None, - h_sep="\penalty0 ", h_char="\penalty5000 ", + h_sep="\penalty0{}", h_char="\penalty5000{}", h_start=3, h_stop=3): self.codec = codec self.seps = r":/\@=?#;-."
Hum, so this means that my tag is processed by the UrlHyphenator class. I have an easy fix in dbtexmf/dblatex/texhyphen.py, just replace h_sep and h_char like this: def __init__(self, codec=None, h_sep="\penalty0{}", h_char="\penalty5000{}", h_start=3, h_stop=3): This seems to work for me without any side-effect so far.
hyphen-encode can sometimes drop meaningful spaces
To be clear, I have the feeling that the above backtrace does not match the segfault...