Added the complete list of horizontal text quote marks in unicode format from wikipedia
This commit is contained in:
@@ -70,3 +70,53 @@ class nwLabels():
|
||||
}
|
||||
|
||||
# END Class nwLabels
|
||||
|
||||
class nwQuotes():
|
||||
"""Allowed quotation marks.
|
||||
Source: https://en.wikipedia.org/wiki/Quotation_mark
|
||||
"""
|
||||
|
||||
SYMBOLS = [
|
||||
"\u0022", # Quotation mark
|
||||
"\u0027", # Apostrophe
|
||||
"\u00ab", # Left-pointing double angle quotation mark
|
||||
"\u00bb", # Right-pointing double angle quotation mark
|
||||
"\u2018", # Left single quotation mark
|
||||
"\u2019", # Right single quotation mark
|
||||
"\u201a", # Single low-9 quotation mark
|
||||
"\u201b", # Single high-reversed-9 quotation mark
|
||||
"\u201c", # Left double quotation mark
|
||||
"\u201d", # Right double quotation mark
|
||||
"\u201e", # Double low-9 quotation mark
|
||||
"\u201f", # Double high-reversed-9 quotation mark
|
||||
"\u2039", # Single left-pointing angle quotation mark
|
||||
"\u203a", # Single right-pointing angle quotation mark
|
||||
"\u2e42", # Double low-reversed-9 quotation mark
|
||||
"\u300c", # Left corner bracket
|
||||
"\u300d", # Right corner bracket
|
||||
"\u300e", # Left white corner bracket
|
||||
"\u300f", # Right white corner bracket
|
||||
]
|
||||
HTML = {
|
||||
"\u0022" : """,
|
||||
"\u0027" : "'",
|
||||
"\u00ab" : "«",
|
||||
"\u00bb" : "»",
|
||||
"\u2018" : "‘",
|
||||
"\u2019" : "’",
|
||||
"\u201a" : "‚",
|
||||
"\u201b" : "‛",
|
||||
"\u201c" : "“",
|
||||
"\u201d" : "”",
|
||||
"\u201e" : "„",
|
||||
"\u201f" : "‟",
|
||||
"\u2039" : "‹",
|
||||
"\u203a" : "›",
|
||||
"\u2e42" : "⹂",
|
||||
"\u300c" : "「",
|
||||
"\u300d" : "」",
|
||||
"\u300e" : "『",
|
||||
"\u300f" : "』",
|
||||
}
|
||||
|
||||
# END Class nwQuotes
|
||||
+3
-10
@@ -23,7 +23,8 @@ from PyQt5.QtWidgets import (
|
||||
QWidget, QTabWidget, QDialogButtonBox, QSpinBox, QGroupBox, QComboBox, QMessageBox,
|
||||
QCheckBox, QGridLayout, QFontComboBox
|
||||
)
|
||||
from nw.enum import nwAlert
|
||||
from nw.enum import nwAlert
|
||||
from nw.constants import nwQuotes
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -460,17 +461,9 @@ class GuiConfigEditEditor(QWidget):
|
||||
##
|
||||
|
||||
def _checkQuoteSymbol(self, toCheck):
|
||||
validOnes = [
|
||||
"\"","'",
|
||||
"“","”","„",
|
||||
"‘","’","‚",
|
||||
"«","»","‹","›",
|
||||
"『","』","「","」",
|
||||
"《","》","〈","〉"
|
||||
]
|
||||
if len(toCheck) != 1:
|
||||
return False
|
||||
if toCheck in validOnes:
|
||||
if toCheck in nwQuotes.SYMBOLS:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user