Skip to content

Commit

Permalink
Replace the disallowd block tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
herablog committed Mar 24, 2016
1 parent ac741c2 commit 8145b3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/disallowed-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function replaceInlineTags() {
function replaceBlockTags() {
var _this3 = this;

var selectors = ['fieldset', 'legend'];
var selectors = ['fieldset', 'legend', 'marquee'];
this.$(this.$(selectors.join(',')).get().reverse()).each(function (i, el) {
var $el = _this3.$(el);
var $conainer = _this3.$('<div>');
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/disallowed-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function replaceInlineTags() {
function replaceBlockTags() {
const selectors = [
'fieldset',
'legend'
'legend',
'marquee'
];
this.$(this.$(selectors.join(',')).get().reverse()).each((i, el) => {
const $el = this.$(el);
Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/disallowed-tags-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe('disallowed-tags', () => {
expect(result).to.equal(fixture);
});
it('replaces disallowed block tags.', () => {
const html = '<fieldset><legend><span>aaa</span></legend></fieldset>';
const fixture = '<div><div><span>aaa</span></div></div>';
const html = '<fieldset><legend><marquee><span>aaa</span></marquee></legend></fieldset>';
const fixture = '<div><div><div><span>aaa</span></div></div></div>';
const builder = ampBuilder(html);
const result = builder.replaceDisallowedTags().html();
expect(result).to.equal(fixture);
Expand Down

0 comments on commit 8145b3e

Please sign in to comment.