mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-17 16:47:05 +00:00
fix: update indentation regex to match non-breaking spaces
The auto-indent regex /^ */ only matched regular spaces. After preserving nbsp characters, browsers may use \xa0 for leading whitespace, causing auto-indentation to fail. Updated to /^[ \xa0]*/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
18013c89db
commit
976ebb116b
1 changed files with 1 additions and 1 deletions
|
|
@ -1270,7 +1270,7 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
const thisLine = rep.lines.atIndex(lineNum);
|
||||
const prevLine = rep.lines.prev(thisLine);
|
||||
const prevLineText = prevLine.text;
|
||||
let theIndent = /^ *(?:)/.exec(prevLineText)[0];
|
||||
let theIndent = /^[ \xa0]*(?:)/.exec(prevLineText)[0];
|
||||
const shouldIndent = window.clientVars.indentationOnNewLine;
|
||||
if (shouldIndent && /[[(:{]\s*$/.exec(prevLineText)) {
|
||||
theIndent += THE_TAB;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue