mirror of
https://github.com/open-webui/open-webui
synced 2025-03-23 06:17:24 +00:00
refac: rich text input behaviour
This commit is contained in:
parent
5499b5acc8
commit
4c691c0edb
@ -168,11 +168,12 @@
|
||||
}
|
||||
|
||||
function boldRule(schema) {
|
||||
return markInputRule(/\*([^*]+)\*/, schema.marks.strong);
|
||||
return markInputRule(/(?<=^|\s)\*([^*]+)\*(?=\s|$)/, schema.marks.strong);
|
||||
}
|
||||
|
||||
function italicRule(schema) {
|
||||
return markInputRule(/\_([^*]+)\_/, schema.marks.em);
|
||||
// Using lookbehind and lookahead to prevent the space from being consumed
|
||||
return markInputRule(/(?<=^|\s)_([^*_]+)_(?=\s|$)/, schema.marks.em);
|
||||
}
|
||||
|
||||
// Initialize Editor State and View
|
||||
|
Loading…
Reference in New Issue
Block a user