Hi Dag
I'm working through the issues one at a time.
On 26/10/11 13:45, Dag Wieers wrote:
- Preserve line-breaks and whitespaces in listing blocks
https://github.com/dagwieers/asciidoc-odf/issues/2
The ODF specification automatically discards consecutive whitespaces
(incl. newlines) and expects <text:s/> and <text:line-break/> instead.
Currently we have implemented our needs using a line_break.py filter,
and modified the code-filter.py, but the problem is that it makes it
hard or impossible to use other filters, unless they get a similar fix
for ODF.
If AsciiDoc would be (made) aware of this requirement, we could tell
the backend.conf that this format requires whitespace-translations for
literal blocks. Maybe a block-attribute or something is needed ?
Another problem with ODF and whitespaces is that any newline introduced
in paragraphs is considered a whitespace too. Which means that if you
add a line-break, and the line-break also adds a newline, the next line
starts with a whitespace. Because of this my current converted ODF
files contain a lot of spurious whitespaces that are hard to get rid
of. Here AsciiDoc could also be careful not to add any newlines.
Unfortunately when using 'conditional attributes' that are line-based,
newlines are omnipresent in paragraph text :-(
I think the 'replacements2' replacements could be used e.g
In the conf file:
[miscellaneous]
subsnormal=specialcharacters,quotes,attributes,specialwords,replacements,macros
subsverbatim=specialcharacters,callouts,replacements2
[replacements2]
(\n|$)=<text:line-break/>\n
\s=<text:s/>
The [miscellaneous] entries are to remove 'replacements2' from normal
substitutions and add it to verbatim substitutions.
The only remaining problem is that there are a couple of places where the
subsnormal redefinition is not honored, this would be easy to fix, or maybe add
a new 'replacements3' set of replacements (though it's unlikely this would break
any existing use of 'replacements2' as it occurs after all other substitutions
and was added specifically to insert backend markup (for the experimental LaTeX
backend)).
Cheers, Stuart
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.