more cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-12-12 16:43:32 +03:00
parent 8383f7ed80
commit 6dfd4a308a
2 changed files with 22 additions and 18 deletions

View File

@ -256,23 +256,23 @@ var blocks = {
return text return text
// markdown... // markdown...
// style: headings... // style: headings...
.replace(/^(?<!\\)######\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-6'])) .replace(/^(?<!\\)######\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-6']))
.replace(/^(?<!\\)#####\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-5'])) .replace(/^(?<!\\)#####\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-5']))
.replace(/^(?<!\\)####\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-4'])) .replace(/^(?<!\\)####\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-4']))
.replace(/^(?<!\\)###\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-3'])) .replace(/^(?<!\\)###\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-3']))
.replace(/^(?<!\\)##\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-2'])) .replace(/^(?<!\\)##\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-2']))
.replace(/^(?<!\\)#\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-1'])) .replace(/^(?<!\\)#\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-1']))
// style: list... // style: list...
//.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item')) //.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item'))
.replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list')) .replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list'))
.replace(/^\s*(.*)(?<!\\)#\s*$/, this.style(editor, elem, 'numbered-list')) .replace(/^\s*(.*)(?<!\\)#\s*$/, this.style(editor, elem, 'numbered-list'))
// style: misc... // style: misc...
.replace(/^\s*(?<!\\)>\s+(.*)$/m, this.style(editor, elem, 'quote')) .replace(/^\s*(?<!\\)>\s+(.*)$/, this.style(editor, elem, 'quote'))
.replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/m, this.style(editor, elem, 'comment')) .replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/, this.style(editor, elem, 'comment'))
.replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/m, this.style(editor, elem, 'NOTE')) .replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/, this.style(editor, elem, 'NOTE'))
.replace(/^\s*(?<!\\)XXX\s+(.*)$/m, this.style(editor, elem, 'XXX')) .replace(/^\s*(?<!\\)XXX\s+(.*)$/, this.style(editor, elem, 'XXX'))
.replace(/^(.*)\s*(?<!\\)XXX$/m, this.style(editor, elem, 'XXX')) .replace(/^(.*)\s*(?<!\\)XXX\s*$/, this.style(editor, elem, 'XXX'))
.replace(/^\s*---\s*$/m, this.style(editor, elem, 'hr', '<hr>')) } , .replace(/^\s*---\+\s*$/, this.style(editor, elem, 'hr', '<hr>')) } ,
} }
@ -733,7 +733,7 @@ var styling = {
.replace(/(\s*)(?<!\\)(ASAP|TEST|BUG|FIX|HACK|STUB|WARNING|CAUTION)(\s*)/gm, .replace(/(\s*)(?<!\\)(ASAP|TEST|BUG|FIX|HACK|STUB|WARNING|CAUTION)(\s*)/gm,
'$1<span class="highlight $2">$2</span>$3') '$1<span class="highlight $2">$2</span>$3')
// elements... // elements...
.replace(/(\n|^)(?<!\\)---*\h*(\n|$)/m, '$1<hr>') .replace(/(\n|^)(?<!\\)---+[\t ]*(\n|$)/m, '$1<hr>')
// basic styling... // basic styling...
.replace(/(?<!\\)\*(?=[^\s*])(([^*]|\\\*)*[^\s*])(?<!\\)\*/gm, '<b>$1</b>') .replace(/(?<!\\)\*(?=[^\s*])(([^*]|\\\*)*[^\s*])(?<!\\)\*/gm, '<b>$1</b>')
.replace(/(?<!\\)~(?=[^\s~])(([^~]|\\~)*[^\s~])(?<!\\)~/gm, '<s>$1</s>') .replace(/(?<!\\)~(?=[^\s~])(([^~]|\\~)*[^\s~])(?<!\\)~/gm, '<s>$1</s>')

View File

@ -52,11 +52,6 @@ var setup = function(){
- this _seems `to` work_ - this _seems `to` work_
- `while` _this `does` not_ - `while` _this `does` not_
- _seems to be connected with quoting..._ - _seems to be connected with quoting..._
- BUG? should the following render to the save view? (currently not)
- text<hr>text
- text
<hr>
text (extra newline rendered)
- BUG: mobile browsers behave quite chaotically ignoring parts of the styling... - BUG: mobile browsers behave quite chaotically ignoring parts of the styling...
- FF: - FF:
- zooming on edited field - zooming on edited field
@ -68,6 +63,15 @@ var setup = function(){
- left side does not need to be as wide - left side does not need to be as wide
- BUG? `.code` is currently over-extended and covers the whole element area (incl. `.children`) - BUG? `.code` is currently over-extended and covers the whole element area (incl. `.children`)
- this currently has no side-effects but is not pretty (???) - this currently has no side-effects but is not pretty (???)
- DONE BUG? should the following render to the save view? (currently not)
collapsed:: true
- text<hr>text
- text
<hr>
text (extra newline rendered)
- text
---
text
- DONE BUG: caret positioning broken (ASAP CLEANUP: GETTEXT) - DONE BUG: caret positioning broken (ASAP CLEANUP: GETTEXT)
collapsed:: true collapsed:: true
- Strategies to test:: - Strategies to test::