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
// markdown...
// style: headings...
.replace(/^(?<!\\)######\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-6']))
.replace(/^(?<!\\)#####\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-5']))
.replace(/^(?<!\\)####\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-4']))
.replace(/^(?<!\\)###\s+(.*)$/m, this.style(editor, elem, ['heading', 'heading-3']))
.replace(/^(?<!\\)##\s+(.*)$/m, 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-6']))
.replace(/^(?<!\\)#####\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-5']))
.replace(/^(?<!\\)####\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-4']))
.replace(/^(?<!\\)###\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-3']))
.replace(/^(?<!\\)##\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-2']))
.replace(/^(?<!\\)#\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-1']))
// style: list...
//.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item'))
.replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list'))
.replace(/^\s*(.*)(?<!\\)#\s*$/, this.style(editor, elem, 'numbered-list'))
// style: misc...
.replace(/^\s*(?<!\\)>\s+(.*)$/m, this.style(editor, elem, 'quote'))
.replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/m, this.style(editor, elem, 'comment'))
.replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/m, this.style(editor, elem, 'NOTE'))
.replace(/^\s*(?<!\\)XXX\s+(.*)$/m, this.style(editor, elem, 'XXX'))
.replace(/^(.*)\s*(?<!\\)XXX$/m, this.style(editor, elem, 'XXX'))
.replace(/^\s*---\s*$/m, this.style(editor, elem, 'hr', '<hr>')) } ,
.replace(/^\s*(?<!\\)>\s+(.*)$/, this.style(editor, elem, 'quote'))
.replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/, this.style(editor, elem, 'comment'))
.replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/, this.style(editor, elem, 'NOTE'))
.replace(/^\s*(?<!\\)XXX\s+(.*)$/, this.style(editor, elem, 'XXX'))
.replace(/^(.*)\s*(?<!\\)XXX\s*$/, this.style(editor, elem, 'XXX'))
.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,
'$1<span class="highlight $2">$2</span>$3')
// elements...
.replace(/(\n|^)(?<!\\)---*\h*(\n|$)/m, '$1<hr>')
.replace(/(\n|^)(?<!\\)---+[\t ]*(\n|$)/m, '$1<hr>')
// basic styling...
.replace(/(?<!\\)\*(?=[^\s*])(([^*]|\\\*)*[^\s*])(?<!\\)\*/gm, '<b>$1</b>')
.replace(/(?<!\\)~(?=[^\s~])(([^~]|\\~)*[^\s~])(?<!\\)~/gm, '<s>$1</s>')

View File

@ -52,11 +52,6 @@ var setup = function(){
- this _seems `to` work_
- `while` _this `does` not_
- _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...
- FF:
- zooming on edited field
@ -68,6 +63,15 @@ var setup = function(){
- left side does not need to be as wide
- BUG? `.code` is currently over-extended and covers the whole element area (incl. `.children`)
- 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)
collapsed:: true
- Strategies to test::