Changeset 755

Show
Ignore:
Timestamp:
03/04/11 15:48:47 (15 months ago)
Author:
mgalloy
Message:

Fix to rst format parser so that ', ", or ` can be used to quote attributes containing commas.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/parser/docparrstformatparser__define.pro

    r751 r755  
    480480      ;   4: required     
    481481      for a = 0L, n_elements(attributes) - 1L do begin 
    482         if (strmid(attributes[a], strpos(attributes[a], '=') + 1L, 1) eq '"') then begin 
     482        quote = strmid(attributes[a], strpos(attributes[a], '=') + 1L, 1) 
     483        if (quote eq '"' || quote eq '`' || quote eq '''') then begin 
    483484          ; add following attributes until closing quote or end of line 
    484485          i = a + 1L 
     
    488489            attributes[i] = '' 
    489490             
    490             if (strpos(t, '"') ne -1L) then break 
     491            if (strpos(t, quote) ne -1L) then break 
    491492             
    492493            i++ 
     
    494495           
    495496          ; fix up attributes[a] by removing quotes 
    496           firstQuote = strpos(attributes[a], '"') 
    497           secondQuote = strpos(attributes[a], '"', firstQuote + 1L) 
     497          firstQuote = strpos(attributes[a], quote) 
     498          secondQuote = strpos(attributes[a], quote, firstQuote + 1L) 
    498499          if (secondQuote eq -1L) then secondQuote = strlen(attributes[a]) 
    499500          valueLength = secondQuote - firstQuote - 1L