differentiate between nbsp and other whitespace (#348)

pull/352/head
Rich-Harris 8 years ago
parent d8dbe4e94e
commit ce6178d281

@ -1 +1 @@
export const whitespace = /\s/; export const whitespace = /[ \t\r\n]/;

@ -0,0 +1,8 @@
export default {
html: `<span>&nbsp;</span>`,
test ( assert, component, target ) {
const text = target.querySelector( 'span' ).textContent;
assert.equal( text.charCodeAt( 0 ), 160 );
}
};

@ -0,0 +1 @@
<span>&nbsp;</span>

@ -0,0 +1 @@
<span>&nbsp;</span>

@ -0,0 +1,27 @@
{
"hash": 2678229240,
"html": {
"start": 0,
"end": 19,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 19,
"type": "Element",
"name": "span",
"attributes": [],
"children": [
{
"start": 6,
"end": 12,
"type": "Text",
"data": " "
}
]
}
]
},
"css": null,
"js": null
}
Loading…
Cancel
Save