Added unicode constants class, and support for non-breaking spaces, which aren't preserved on save.

This commit is contained in:
Veronica K. B. Olsen
2019-10-29 11:35:40 +01:00
parent 2c63d1fbf2
commit 146756a395
6 changed files with 111 additions and 35 deletions
+60 -20
View File
@@ -142,26 +142,66 @@ class nwQuotes():
"\u300e", # Left white corner bracket
"\u300f", # Right white corner bracket
]
# END Class nwQuotes
class nwUnicode:
"""Suppoted unicode character constants and translation maps.
"""
# Quotation Marks
U_QUOT = "\u0022" # Quotation mark
U_APOS = "\u0027" # Apostrophe
U_LAQUO = "\u00ab" # Left-pointing double angle quotation mark
U_RAQUO = "\u00bb" # Right-pointing double angle quotation mark
U_LSQUO = "\u2018" # Left single quotation mark
U_RSQUO = "\u2019" # Right single quotation mark
U_SBQUO = "\u201a" # Single low-9 quotation mark
U_SUQUO = "\u201b" # Single high-reversed-9 quotation mark
U_LDQUO = "\u201c" # Left double quotation mark
U_RDQUO = "\u201d" # Right double quotation mark
U_BDQUO = "\u201e" # Double low-9 quotation mark
U_UDQUO = "\u201f" # Double high-reversed-9 quotation mark
U_LSAQUO = "\u2039" # Single left-pointing angle quotation mark
U_RSAQUO = "\u203a" # Single right-pointing angle quotation mark
U_BDRQUO = "\u2e42" # Double low-reversed-9 quotation mark
U_LCQUO = "\u300c" # Left corner bracket
U_RCQUO = "\u300d" # Right corner bracket
U_LWCQUO = "\u300e" # Left white corner bracket
U_RECQUO = "\u300f" # Right white corner bracket
# Punctuation
U_NDASH = "\u2013" # Short dash
U_MDASH = "\u2014" # Long dash
U_HELLIP = "\u2026" # Ellipsis
# Other
U_NBSP = "\u00a0" # Non-breaking space
HTML = {
"\u0022" : """,
"\u0027" : "'",
"\u00ab" : "«",
"\u00bb" : "»",
"\u2018" : "‘",
"\u2019" : "’",
"\u201a" : "‚",
"\u201b" : "‛",
"\u201c" : "“",
"\u201d" : "”",
"\u201e" : "„",
"\u201f" : "‟",
"\u2039" : "‹",
"\u203a" : "›",
"\u2e42" : "⹂",
"\u300c" : "「",
"\u300d" : "」",
"\u300e" : "『",
"\u300f" : "』",
U_QUOT : """,
U_APOS : "'",
U_LAQUO : "«",
U_RAQUO : "»",
U_LSQUO : "‘",
U_RSQUO : "’",
U_SBQUO : "‚",
U_SUQUO : "‛",
U_LDQUO : "“",
U_RDQUO : "”",
U_BDQUO : "„",
U_UDQUO : "‟",
U_LSAQUO : "‹",
U_RSAQUO : "›",
U_BDRQUO : "⹂",
U_LCQUO : "「",
U_RCQUO : "」",
U_LWCQUO : "『",
U_LWCQUO : "『",
U_NDASH : "–",
U_MDASH : "—",
U_HELLIP : "…",
U_NBSP : " ",
}
# END Class nwQuotes
# END Class nwUnicode