Skip to content

Commit

Permalink
Add underline, subscript, superscript and strikethrough markup
Browse files Browse the repository at this point in the history
  • Loading branch information
vitosamson authored and mixonic committed Nov 9, 2015
1 parent 6bb42bf commit cae444c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/js/models/markup.js
Expand Up @@ -8,7 +8,11 @@ export const VALID_MARKUP_TAGNAMES = [
'i',
'strong',
'em',
'a'
'a',
'u',
'sub', // subscript
'sup', // superscript
's' // strikethrough
].map(normalizeTagName);

export const VALID_ATTRIBUTES = [
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/parsers/dom-test.js
Expand Up @@ -227,11 +227,11 @@ test('link (A tag) is parsed', (assert) => {
});

test('unrecognized tags are ignored', (assert) => {
let element = buildDOM(`<p>before<sub>sub</sub>after</p>`);
let element = buildDOM(`<p>before<span>span</span>after</p>`);
const post = parser.parse(element);

assert.equal(post.sections.length, 1, '1 section');
assert.equal(post.sections.objectAt(0).text, 'beforesubafter');
assert.equal(post.sections.objectAt(0).text, 'beforespanafter');
assert.equal(post.sections.objectAt(0).markers.length, 1, '1 marker');
});

Expand Down

0 comments on commit cae444c

Please sign in to comment.