Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tagged text should not be escaped #11

Closed
GoogleCodeExporter opened this issue Apr 18, 2015 · 16 comments
Closed

tagged text should not be escaped #11

GoogleCodeExporter opened this issue Apr 18, 2015 · 16 comments

Comments

@GoogleCodeExporter
Copy link

Txt2tags should never touch anything inside the ''tagged mark'', even the 
special escapes. Today, 
doFinalEscape() is performed inside tagged texts. Example in tex:�

$ echo -e "\nTest ''pass/pass''" | txt2tags -i- -o- -H -t lout

@LP
Test pass"/"pass


-- thanks Barrie Stott for reporting

Original issue reported on code.google.com by aureliojargas@gmail.com on 7 Apr 2009 at 8:54

@GoogleCodeExporter
Copy link
Author

I think this is related to a problem I ran into:

txt2tags should probably not turn _ into \_ in raw text for tex.

Original comment by jendriks...@gmail.com on 17 Aug 2009 at 3:24

@GoogleCodeExporter
Copy link
Author

Txt2tags (2.5 & r92) erroneously escapes '<', '&' and '>' in raw (double 
double-quoted) text for targets 'html' & 'xhtml'.
Is this the same issue?

e.g.
echo '\
""<br/>""' | txt2tags -i- -o- -H -t xhtml

outputs:
    <p>
    <br/>
    </p>

should be:
    <p>
    <br/>
    </p>

And
echo '\
""<&>""' | txt2tags -i- -o- -H -t xhtml

outputs:
    <p>
    <&>
    </p>

should be:
    <p>
    <&>
    </p>

Original comment by chris...@gmail.com on 19 May 2010 at 1:05

@GoogleCodeExporter
Copy link
Author

Chris,

The correct mark to use in this case is the ''tagged'' mark, with two 
apostrofes. See:

$ echo -e "\n''<br&/>'' " | txt2tags -i- -o- -H -t xhtml
<p>
<br&/>
</p>

The raw mark you were using is just to protect the text from txt2tags marks, 
but the target's specific escapes are still performed.

Original comment by aureliojargas@gmail.com on 5 Aug 2010 at 2:34

@GoogleCodeExporter
Copy link
Author

Just to make it clear, this bug affects only the ''tagged'' mark, not the 
""raw"" mark.

The targets affected in this bug are targets that make use of the 
doFinalEscape() function, which now are: pm6, man, sgml, lout, tex.

Original comment by aureliojargas@gmail.com on 5 Aug 2010 at 2:37

@GoogleCodeExporter
Copy link
Author

Aurélio,

OK.  That's absolutely fine.
Is the '' (quote-quote) mark documented?
I can't find it in the 2.5 userguide.pdf or quickref.pdf.

[Perhaps it should be named 'Raw' and "" (double double-quote) renamed "Rare" 
;-).]

Original comment by chris...@gmail.com on 6 Aug 2010 at 12:54

@GoogleCodeExporter
Copy link
Author

Chris, the tagged mark is now available in new txt2tags-2.6, and of course, in 
SVN :) Docs were updated recently.

Original comment by aureliojargas@gmail.com on 9 Nov 2010 at 8:41

@GoogleCodeExporter
Copy link
Author

I have prepared a patch that should fix this issue. What do you think?

Original comment by jendriks...@gmail.com on 16 May 2012 at 1:39

Attachments:

@GoogleCodeExporter
Copy link
Author

Jendrik,

What a nice elegant solution you've found, I liked that, thanks!

I can't stress-test this patch right now, but looking at the code it seems it's 
all OK. Can you commit it, please?

Original comment by aureliojargas@gmail.com on 17 May 2012 at 1:09

@GoogleCodeExporter
Copy link
Author

The patch has been committed.

Original comment by jendriks...@gmail.com on 17 May 2012 at 7:15

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thanks! Fixed in r895.

Original comment by aureliojargas@gmail.com on 18 May 2012 at 5:05

@fgallaire fgallaire reopened this Jul 4, 2015
@fgallaire
Copy link
Member

Don't understand all, but commit 20405d8 (formerly r895) introduce a bug for me, in the sample.t2t:
We use double *, /, - and _ to represent **bold**,
was converted in:
We use double *, /, - and \_ to represent \textbf{bold},
and now becomes:
We use double *, /, - and $\backslash$_ to represent \textbf{bold},
and doesn't compile correctly anymore.

@farvardin
Copy link
Contributor

yes, I got this problem too on my LaTeX files, it's the reason why on
textallion I'm still using r804 of txt2tags (
https://bitbucket.org/farvardin/textallion/src/5010384ce0875d87cdde673b3d4344265f827e1a/contrib/txt2tags/txt2tags?at=default
)

You can find the diff of some errors I got there:
http://pastebin.com/xbbFCrWu

(t2t source file is at
https://bitbucket.org/farvardin/textallion/src/5010384ce0875d87cdde673b3d4344265f827e1a/docs/documentation_en.t2t?at=default
)

2015-07-04 3:30 GMT+02:00 Florent Gallaire notifications@github.com:

Don't understand all, but commit 20405d8
20405d8
(formerly r895) introduce a bug for me, in the sample.t2t:
We use double , /, - and _ to represent _bold*,
was converted in:
We use double *, /, - and _ to represent \textbf{bold},
and now becomes:
We use double *, /, - and $\backslash$
to represent \textbf{bold},
and doesn't compile correctly anymore.


Reply to this email directly or view it on GitHub
#11 (comment).

@jendrikseipp
Copy link

Thanks for the heads up! I could reproduce the error on my end and think it can be fixed by just swapping the position of the two Latex escapes. I am a little reluctant to do the fix though, because I don't see the point in fixing the same error in both txt2tags versions. Rather, I'd like to see us moving forward in issue #190.

@fgallaire
Copy link
Member

@jendrikseipp txt2tags repo is now ready for your fix (for both txt2tags ^^).

@jendrikseipp jendrikseipp added this to the v2.7 milestone Aug 2, 2015
@fgallaire
Copy link
Member

@jendrikseipp could you apply your patch as this is the most important bug to fix before 2.7 release ?

jendrikseipp pushed a commit that referenced this issue Feb 17, 2023
@jendrikseipp
Copy link

This is now fixed in the v3 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants