forked from LiveCarta/BookConverter
Add regex processing of span wraps
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import re
|
||||
|
||||
|
||||
class LiveCartaConfig:
|
||||
"""Class of values that LiveCarta platform using and supports"""
|
||||
# tag with inline style to be updated with style attribute
|
||||
@@ -87,6 +90,14 @@ class LiveCartaConfig:
|
||||
'decimal-leading-zero', 'georgian', 'lower-alpha', 'lower-latin',
|
||||
'lower-roman', 'upper-alpha', 'upper-latin', 'upper-roman', 'none']
|
||||
|
||||
structural_tags_names = [
|
||||
'div', 'section', 'article', 'main', 'body', 'html', 'aside',
|
||||
'canvas', 'data', 'figure', 'footer', 'iframe', 'span', 'p'
|
||||
]
|
||||
|
||||
could_have_style_in_livecarta_regexp = re.compile(
|
||||
'(^div$)|(^p$)|(^span$)|(^code$)|(^kbd$)|(^var$)|(^li$)|(^ul$)|(^ol$)|(^td$)|(^th$)|(^h[1-9]$)')
|
||||
|
||||
"""
|
||||
LIVECARTA_STYLE_ATTRS_SHOULD_BE_TAG = { (property, value): tag }
|
||||
|
||||
@@ -105,3 +116,11 @@ class LiveCartaConfig:
|
||||
('text-decoration-line', 'line-through'): 's',
|
||||
('vertical-align', 'super'): 'sup'
|
||||
}
|
||||
|
||||
LIVECARTA_STYLES_CANT_BE_IN_TAG = {
|
||||
'p': ['text-align', 'text-indent', 'border-bottom', 'border-top'],
|
||||
'li': ['text-align', 'list-style-type'],
|
||||
'ul': ['list-style-type'],
|
||||
'ol': ['list-style-type'],
|
||||
'(^h[1-9]$)': ['list-style-type']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user