Hello!

Jumping later on the discussion, carnival days here in Brazil.

Let me explain the intended purpose of each block, so maybe we can
share a common view.


On Thu, Feb 11, 2010 at 04:02, Emmanuel Godard
<emmanuel.god...@lif.univ-mrs.fr> wrote:

> But I do agree here. It should be interesting, within this thread and
> considering the introduction of this third ultraraw mark to discuss more
> about this. What are the associated use cases for verbatim like mode?
> What is really needed ?(3 marks for verbatim related operations are
> maybe too much. And what about escaping?)
>
> IMHO, there is need for only two use cases:
> 1) code listings and the likes
> 2) target tagged code
>
> And so only 2 "verbatim like" tags
> 1) verbatim inline/block : that *are to be rendered* exactly as
> formatted, in monospaced font
> 2) tagged inline/block: that are included verbatim in the target code
>  (*no* escaping, not even conditionally)

In txt2tags we have three special blocks where txt2tags marks (like
**bold**) are not parsed:

1) verbatim

Mark: ```
Action: fixed-font text, line-breaks preserved, target escapes apply.
Purpose: show code listings

2)  raw

Mark: """
Action: target escapes apply.
Purpose: show txt2tags marks on the target document, like **bold** (literally).

3) tagged (SVN-only)

Mark: '''
Action: nothing.
Purpose: let the user create tagged text

---------------------------

With that in mind, this is the intended use of this blocks:

1) Verbatim: code listings (think <PRE> in HTML)

2) Raw: txt2tags documentation

3) Tagged: user code (think <DIV id="foo"> and &copy; in HTML,
formulas in TeX, etc)

----------------------------

As you can see, the raw mark was created mainly to produce the
txt2tags guides, because I needed to insert literal texts like
**bold** and didn't want them to be parsed as a txt2tags mark. I doubt
users not writing txt2tags documentation will have much use for this
mark. So it's better to just forget it.

The new Tagged mark (only in SVN now), came to let users type target's
code directly in the source document, without messing with complicated
postprocs. This is the preferred solution for custom DIVs in HTML and
for TeX formulas. Inside this mark, the text is passed directly
through processing, no parsing, no escaping. The only thing that can
alter this text are pre/postproc filters.

So, in short: if you want to include special codes like formulas in
TeX, use the ''tagged'' mark. No escaping will be done, your text will
be left as is. (See bug notes below)


> And discussing this area of escaping, there are currently some
> discrepancies in the way the block/inline versions of each
> raw/verbatim/tagged marks are treated. Just to keep on the LaTeX use
> case, this is what is escaped (E) or not escaped (N) according to the
> marks (please correct me if necessary)
>
>        ""       """     ``     ```    ''      '''
> \        E        E       E      N      N       N
> _        E        N       E      N      E       N
>

Thanks for the tests Emmanuel! TeX is very tricky and it's escaping is
the most complex of all targets.

Let me analyze your results.

raw: The text should *always* be escaped inside raw blocks and
inlines. The """ _ not escaped is a bug and needs to be fixed.

verbatim: it's tricky, since some targets use different tags for
blocks and inlines. For example, in HTML it's PRE and CODE. In TeX
it's \begin{verbatim} and \texttt. That explains why the blocks are
not escaped and the inlines are. It changes from target to target and
txt2tags tries to make it right.

tagged: The text should *never* be escaped inside tagged blocks and
inlines, so the escaping in ''_'' is a bug  and needs to be fixed.

This is the correct behavior:

         ""       """      ``      ```     ''       '''
 \        E        E       E      N      N       N
 _        E        E       E      N      N       N


I'll fix the bug with the _ handling inside inlines in TeX. It's a
dirty exception that always gives me nightmares... For now, use the
tagged BLOCK to avoid the escaping bug.

On the other targets, everything should be OK, following the correct behavior.


-- 
Aurélio | www.aurelio.net | @oreio

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to