diff --git a/app/assets/javascripts/discourse/dialects/table_dialect.js b/app/assets/javascripts/discourse/dialects/table_dialect.js index d73393023e2..ad1bb375dff 100644 --- a/app/assets/javascripts/discourse/dialects/table_dialect.js +++ b/app/assets/javascripts/discourse/dialects/table_dialect.js @@ -23,7 +23,7 @@ var emitter = function(contents) { }; var tableBlock = { - start: /()([\S\s]*)/igm, + start: /(]*>)([\S\s]*)/igm, stop: /<\/table>/igm, rawContents: true, emitter: emitter, diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index de5e3fbb9cc..bbbcb5d699f 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -343,7 +343,7 @@ describe PrettyText do it 'allows table html' do SiteSetting.allow_html_tables = true PrettyText.reset_context - table = "
\n
test
a
" + table = "\n
test
a
" match = "
test
a
" expect(PrettyText.cook(table)).to match_html(match)