strip classes from table instead of ignoring table

This commit is contained in:
Sam 2015-07-20 17:05:24 +10:00
parent e93665b9f7
commit ecf50a741c
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ var emitter = function(contents) {
}; };
var tableBlock = { var tableBlock = {
start: /(<table>)([\S\s]*)/igm, start: /(<table[^>]*>)([\S\s]*)/igm,
stop: /<\/table>/igm, stop: /<\/table>/igm,
rawContents: true, rawContents: true,
emitter: emitter, emitter: emitter,

View File

@ -343,7 +343,7 @@ describe PrettyText do
it 'allows table html' do it 'allows table html' do
SiteSetting.allow_html_tables = true SiteSetting.allow_html_tables = true
PrettyText.reset_context PrettyText.reset_context
table = "<table><thead><tr>\n<th>test</th></tr></thead><tbody><tr><td>a</td></tr></tbody></table>" table = "<table class='fa-spin'><thead><tr>\n<th>test</th></tr></thead><tbody><tr><td>a</td></tr></tbody></table>"
match = "<table class=\"md-table\"><thead><tr> <th>test</th> </tr></thead><tbody><tr><td>a</td></tr></tbody></table>" match = "<table class=\"md-table\"><thead><tr> <th>test</th> </tr></thead><tbody><tr><td>a</td></tr></tbody></table>"
expect(PrettyText.cook(table)).to match_html(match) expect(PrettyText.cook(table)).to match_html(match)