@@ -8,9 +8,9 @@ import {
|
||||
InterpolationNode
|
||||
} from '@vue/compiler-core'
|
||||
import {
|
||||
parserOptionsMinimal as parserOptions,
|
||||
parserOptionsStandard as parserOptions,
|
||||
DOMNamespaces
|
||||
} from '../src/parserOptionsMinimal'
|
||||
} from '../src/parserOptionsStandard'
|
||||
|
||||
describe('DOM parser', () => {
|
||||
describe('Text', () => {
|
||||
@@ -160,6 +160,16 @@ describe('DOM parser', () => {
|
||||
}
|
||||
])
|
||||
})
|
||||
|
||||
// #945
|
||||
test(' should not be condensed', () => {
|
||||
const nbsp = String.fromCharCode(160)
|
||||
const ast = parse(`foo bar`, parserOptions)
|
||||
expect(ast.children[0]).toMatchObject({
|
||||
type: NodeTypes.TEXT,
|
||||
content: `foo${nbsp}${nbsp}bar`
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Interpolation', () => {
|
||||
|
||||
@@ -2,6 +2,8 @@ import { ParserOptions } from '@vue/compiler-core'
|
||||
import { parserOptionsMinimal } from './parserOptionsMinimal'
|
||||
import namedCharacterReferences from './namedChars.json'
|
||||
|
||||
export { DOMNamespaces } from './parserOptionsMinimal'
|
||||
|
||||
export const parserOptionsStandard: ParserOptions = {
|
||||
// extends the minimal options with more spec-compliant overrides
|
||||
...parserOptionsMinimal,
|
||||
|
||||
Reference in New Issue
Block a user