Tk Library Source Code

Artifact [1ad1a00b03]
Login

Artifact 1ad1a00b03c8b6582a07d0ba2630205073e1aede:

Attachment "html.tcl" to ticket [1294733fff] added by oliversix 2005-09-22 23:03:52.
namespace eval html {

    variable entities {
        \xa0   \xa1 ¡ \xa2 ¢ \xa3 £ \xa4 ¤
        \xa5 ¥ \xa6 ¦ \xa7 § \xa8 ¨ \xa9 ©
        \xaa ª \xab « \xac ¬ \xad ­ \xae ®
        \xaf ¯ \xb0 ° \xb1 ± \xb2 ² \xb3 ³
        \xb4 ´ \xb5 µ \xb6 ¶ \xb7 · \xb8 ¸
        \xb9 ¹ \xba º \xbb » \xbc ¼ \xbd ½
        \xbe ¾ \xbf ¿ \xc0 À \xc1 Á \xc2 Â
        \xc3 Ã \xc4 Ä \xc5 Å \xc6 Æ \xc7 Ç
        \xc8 È \xc9 É \xca Ê \xcb Ë \xcc Ì
        \xcd Í \xce Î \xcf Ï \xd0 Ð \xd1 Ñ
        \xd2 Ò \xd3 Ó \xd4 Ô \xd5 Õ \xd6 Ö
        \xd7 × \xd8 Ø \xd9 Ù \xda Ú \xdb Û
        \xdc Ü \xdd Ý \xde Þ \xdf ß \xe0 à
        \xe1 á \xe2 â \xe3 ã \xe4 ä \xe5 å
        \xe6 æ \xe7 ç \xe8 è \xe9 é \xea ê
        \xeb ë \xec ì \xed í \xee î \xef ï
        \xf0 ð \xf1 ñ \xf2 ò \xf3 ó \xf4 ô
        \xf5 õ \xf6 ö \xf7 ÷ \xf8 ø \xf9 ù
        \xfa ú \xfb û \xfc ü \xfd ý \xfe þ
        \xff ÿ \u192 ƒ \u391 Α \u392 Β \u393 Γ
        \u394 Δ \u395 Ε \u396 Ζ \u397 Η \u398 Θ
        \u399 Ι \u39A Κ \u39B Λ \u39C Μ \u39D Ν
        \u39E Ξ \u39F Ο \u3A0 Π \u3A1 Ρ \u3A3 Σ
        \u3A4 Τ \u3A5 Υ \u3A6 Φ \u3A7 Χ \u3A8 Ψ
        \u3A9 Ω \u3B1 α \u3B2 β \u3B3 γ \u3B4 δ
        \u3B5 ε \u3B6 ζ \u3B7 η \u3B8 θ \u3B9 ι
        \u3BA κ \u3BB λ \u3BC μ \u3BD ν \u3BE ξ
        \u3BF ο \u3C0 π \u3C1 ρ \u3C2 ς \u3C3 σ
        \u3C4 τ \u3C5 υ \u3C6 φ \u3C7 χ \u3C8 ψ
        \u3C9 ω \u3D1 ϑ \u3D2 ϒ \u3D6 ϖ
        \u2022 • \u2026 … \u2032 ′ \u2033 ″
        \u203E ‾ \u2044 ⁄ \u2118 ℘ \u2111 ℑ
        \u211C ℜ \u2122 ™ \u2135 ℵ \u2190 ←
        \u2191 ↑ \u2192 → \u2193 ↓ \u2194 ↔ \u21B5 ↵
        \u21D0 ⇐ \u21D1 ⇑ \u21D2 ⇒ \u21D3 ⇓ \u21D4 ⇔
        \u2200 ∀ \u2202 ∂ \u2203 ∃ \u2205 ∅
        \u2207 ∇ \u2208 ∈ \u2209 ∉ \u220B ∋ \u220F ∏
        \u2211 ∑ \u2212 − \u2217 ∗ \u221A √
        \u221D ∝ \u221E ∞ \u2220 ∠ \u2227 ∧ \u2228 ∨
        \u2229 ∩ \u222A ∪ \u222B ∫ \u2234 ∴ \u223C ∼
        \u2245 ≅ \u2248 ≈ \u2260 ≠ \u2261 ≡ \u2264 ≤
        \u2265 ≥ \u2282 ⊂ \u2283 ⊃ \u2284 ⊄ \u2286 ⊆
        \u2287 ⊇ \u2295 ⊕ \u2297 ⊗ \u22A5 ⊥
        \u22C5 ⋅ \u2308 ⌈ \u2309 ⌉ \u230A ⌊
        \u230B ⌋ \u2329 ⟨ \u232A ⟩ \u25CA ◊
        \u2660 ♠ \u2663 ♣ \u2665 ♥ \u2666 ♦
        \x22 " \x26 & \x3C < \x3E > \u152 Œ
        \u153 œ \u160 Š \u161 š \u178 Ÿ
        \u2C6 ˆ \u2DC ˜ \u2002   \u2003   \u2009  
        \u200C ‌ \u200D ‍ \u200E ‎ \u200F ‏ \u2013 –
        \u2014 — \u2018 ‘ \u2019 ’ \u201A ‚
        \u201C “ \u201D ” \u201E „ \u2020 †
        \u2021 ‡ \u2030 ‰ \u2039 ‹ \u203A ›
        \u20AC €
    }
    
    proc html_entities {s} {
        return [ string map $::html::entities $s ]
    }
    
    proc nl2br {s} {
        return [ string map [ list \n\r <br> \n <br> \r <br> ] $s ]
    }
}