Add a New Comment (Rich Markup)
Comment Type & Canned Response: None No canned response available
source-highlight is agnostic with respect to the output format: it is specified in .outlang files, thus also an outlang not well written could produce an invalid output ;)
thus, the only thing I can do is add the command line to tell source-highlight to preprocess also the title...
Hmm, it's your call. It's still not ideal that the program could produce invalid output, but I suppose it's fine if it's documented in the man page.
One possible (non invasive) solution that comes into my mind is to add a command line option --preprocess-title which performs char translation also on the title string.
It is still reponsibility of the user to explicitly specify that...
does it sound reasonable?
Sure. It's an edge case that most likely comes up only very rarely. Still, perhaps it is possible to fail more gracefully, for example throwing an error message instead of producing invalid output? IMO, the biggest problem was that the program failed in a way that wasn't immediately obvious.
If it's not reasonable to be done in a specific way, perhaps it can be done in a general way. For example, if underscores are known to break with more than one outlang when --doc is used, perhaps it should just not be allowed?
I tried to deal with this issue, but performing character translation in title cannot be done consistently in all output formats:
- in HTML it is not required - in ODT you even get a title which is not displayed correctly
indeed in different output formats translation may not be required or even must not be done in the title tag...
thus I think I cannot fix this; if one gets errors due to the title in an output format he should provide a valid title in that specific format (with --title option, for instance for Latex --title="my\_title").
I don't see other solutions without breaking existing code, or without requiring much more specifications in the .outlang which I'd avoid since this issue shows up only if --doc is specified without a --title...
if --title is specified then it is the user responsibility to provide a valid one...
Underscores are special characters in LaTeX. If possible, source-highlight should try to escape underscores in titles using -f latex and latexcolor.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.10