Browse Source

Markdown format: no newlines in table rows starting with |

merge-requests/393/head
eidheim 7 years ago
parent
commit
c6efc4599f
  1. 4
      src/source.cc

4
src/source.cc

@ -853,6 +853,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
bool monospace = false; bool monospace = false;
bool script = false; bool script = false;
bool html_tag = false; bool html_tag = false;
bool table = false;
int square_brackets = 0; int square_brackets = 0;
do { do {
if(iter.starts_line()) { if(iter.starts_line()) {
@ -870,6 +871,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
iter.forward_chars(3); iter.forward_chars(3);
continue; continue;
} }
table = *iter == '|';
} }
if(!script && *iter == '`') if(!script && *iter == '`')
monospace = !monospace; monospace = !monospace;
@ -883,7 +885,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
else if(*iter == ']') else if(*iter == ']')
--square_brackets; --square_brackets;
} }
if(!headline && !script && !monospace && !html_tag && square_brackets == 0) { if(!headline && !script && !monospace && !html_tag && !table && square_brackets == 0) {
if(*iter == ' ' && iter.get_line_offset() <= 80) if(*iter == ' ' && iter.get_line_offset() <= 80)
last_space_offset = iter.get_offset(); last_space_offset = iter.get_offset();
// Insert newline on long lines // Insert newline on long lines

Loading…
Cancel
Save