Changeset 234
- Timestamp:
- 02/12/2008 13:56:38 (9 months ago)
- Location:
- branches/superredcloth
- Files:
-
- 3 modified
-
ext/superredcloth_scan/superredcloth_inline.rl (modified) (3 diffs)
-
lib/superredcloth.rb (modified) (1 diff)
-
test/hobix.yml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/superredcloth/ext/superredcloth_scan/superredcloth_inline.rl
r231 r234 82 82 acronym = ( [A-Z] >A [A-Z0-9]{2,} %T "(" default+ >A %{ STORE(title) } :> ")" ) >X ; 83 83 caps = ( upper{3,} >A %*T ) >X ; 84 dim = ( digit+ >A %{ STORE(x) } (" x " | "x") digit+ >A %*{ STORE(y)} ) >X ;84 dim = ( digit+ >A %{ STORE(x) } (" x " @{ ASET(space, true)} | "x") digit @{ fhold; } ) >X ; 85 85 tm = [Tt] [Mm] ; 86 86 trademark = " "? ( "[" tm "]" | "(" tm ")" ) ; … … 90 90 copyright = ( "[" cee "]" | "(" cee ")" ) ; 91 91 entity = ( "&" %A ( '#' digit+ | alpha+ ) %T ';' ) >X ; 92 93 other_phrase = phrase -- dim; 94 92 95 93 96 main := |* … … 132 135 html_comment => cat; 133 136 134 phrase => esc;137 other_phrase => esc; 135 138 PUNCT => esc; 136 139 space => esc; -
branches/superredcloth/lib/superredcloth.rb
r232 r234 161 161 162 162 def dim(opts) 163 "#{opts[:x]} × #{opts[:y]}" 163 space = opts[:space] ? " " : '' 164 "#{opts[:x]}#{space}×#{space}" 164 165 end 165 166 -
branches/superredcloth/test/hobix.yml
r232 r234 69 69 desc: The letter 'x' becomes a dimension sign when used between digits. 70 70 in: "Observe: 2x3." 71 out: "<p>Observe: 2 ×3.</p>"71 out: "<p>Observe: 2×3.</p>" 72 72 --- 73 73 name: dimension sign with spaces … … 77 77 name: dimension signs chained 78 78 in: "Observe: 2x3x4." 79 out: "<p>Observe: 2 × 3 ×4.</p>"79 out: "<p>Observe: 2×3×4.</p>" 80 80 --- 81 81 name: trademark and copyright