1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Fixes #9264: Preserve indentation from plain text when pasting on Rich Text Editor (#9828)

This commit is contained in:
pedr
2024-03-02 12:43:38 -03:00
committed by GitHub
parent 53d5cf55bc
commit ff1f1b190e
3 changed files with 28 additions and 2 deletions

View File

@@ -219,7 +219,9 @@ export function escapeHtml(s: string) {
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
.replace(/'/g, '&#039;')
.replace(/^ +/g, match => '&nbsp;'.repeat(match.length))
.replace(/^\t+/g, match => '&nbsp;&nbsp;&nbsp;&nbsp;'.repeat(match.length));
}
// keywords can either be a list of strings, or a list of objects with the format: