Menu

#1 TAX handling of single quoted attributes

open
nobody
None
5
2006-06-09
2006-06-09
No

Tried using tax against a piece of html like this:
<span style='font-family:Arial;mso-fareast-font-family:
"MS Mincho"'>FINDINGS</span>

parsing failed on the single quotes, but I was able to
make it work properly after changing the sub line in
tax::parse from:

set sub "\}\n$cmd {\\2} \[expr \{{\\1} ne \"\"\}\]
\[expr \{{\\4} ne \"\"\}\] \ \[regsub -all -- \{\\s+|(\\s*=\\s*)\} {\\3} \" \"\] \{"

to:

set sub "\}\n$cmd {\\2} \[expr \{{\\1} ne \"\"\}\]
\[expr \{{\\4} ne \"\"\}\] \ \[regsub -all -- \{\\s+|(\\s*=\\s*)\} \[regsub -all
-- \{\\s*=\\s*'(\[^'\]+)'\} {\\3} \{ \{\\\\1\}\}\] \"
\"\] \{"

I'm still an amatuer at tcl, so my brain hurts now ;-)
A diff is attached as well.

-MJ

Discussion

  • Matthew Jimenez

    Matthew Jimenez - 2006-06-09

    Handle single quoting in tax

     
  • Matthew Jimenez

    Matthew Jimenez - 2006-06-09

    Logged In: YES
    user_id=897640

    Additionally, in tax::output, I think it may be a good idea
    to change:
    puts -nonewline " $p=\"$properties($p)\""

    to:
    regsub -all \" $properties($p) {\&amp;quot;} prop
    puts -nonewline " $p=\"$prop\""

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.