|
|
|
|
|
|
|
|
NON_BREAKABLE_SPACE = Charactere(unicode="\u00a0", html=" ") |
|
|
NON_BREAKABLE_SPACE = Charactere(unicode="\u00a0", html=" ") |
|
|
|
|
|
|
|
|
# TODISCUSS: part of the configuration? |
|
|
# TODISCUSS: part of the configuration? |
|
|
COMPUTED_BLOCKS = "|".join(["p", "h[1-6]", "li", "dt", "dd"]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Complete list: |
|
|
|
|
|
# https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements |
|
|
|
|
|
# Intentionnaly excluded: address, article, aside, blockquote, |
|
|
|
|
|
# dialog, div, dl, fieldset, figure, footer, form, hgroup, hr, main, |
|
|
|
|
|
# nav, ol, pre, section, table, ul. |
|
|
|
|
|
COMPUTED_BLOCKS = "|".join(["details", "dt", "dd", "figcaption", "h[1-6]", "li", "p"]) |
|
|
|
|
|
|
|
|
# Complete list: |
|
|
# Complete list: |
|
|
# https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements#list_of_inline_elements |
|
|
# https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements#list_of_inline_elements |
|
|
|
|
|
|
|
|
"span", |
|
|
"span", |
|
|
"strong", |
|
|
"strong", |
|
|
"sub", |
|
|
"sub", |
|
|
|
|
|
"summary", |
|
|
"sup", |
|
|
"sup", |
|
|
"u", |
|
|
"u", |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
Improvements: |
|
|
Improvements: |
|
|
|
|
|
|
|
|
* allow the unbreakable unicode character (new option) |
|
|
* allow the unbreakable unicode character (new option) |
|
|
* add the mark element as a potential inline |
|
|
|
|
|
|
|
|
* consider the support of all pertinent inline and block elements |
|
|
* avoid insertion of a non-breakable space if the sentence is a single word |
|
|
* avoid insertion of a non-breakable space if the sentence is a single word |
|
|
* externalized test suite |
|
|
* externalized test suite |
|
|
""" |
|
|
""" |