[visual] Decorate backslash-prefixed dollar sign (#14552)

GitOrigin-RevId: 3d846eeb1a25051b794a3673e9f48ac7fe4b2cbf
This commit is contained in:
Alf Eaton 2023-09-01 12:08:13 +01:00 committed by Copybot
parent 7004b5bacf
commit a0347c53f0
2 changed files with 7 additions and 0 deletions

View file

@ -35,6 +35,7 @@ const SUBSTITUTIONS = new Map([
['\\&', '\u0026'],
['\\#', '\u0023'],
['\\{', '\u007B'],
['\\$', '\u0024'],
['\\textasciicircum', '\u005E'],
['\\textless', '\u003C'],
['\\textasciitilde', '\u007E'],

View file

@ -626,6 +626,12 @@ describe('<CodeMirrorEditor/> in Visual mode', function () {
cy.get('@first-line').should('have.text', 'Test~test')
})
it('decorates a backslash-prefixed dollar sign with a dollar sign', function () {
cy.get('@first-line').type('\\$5.00')
cy.get('@first-line').should('have.text', '$5.00')
cy.get('.ol-cm-character').should('have.length', 1)
})
it('decorates line breaks', function () {
cy.get('@first-line').type('Test \\\\ test')
cy.get('@second-line').click()