From 37640d707f7f7a1fd864d8f22baa8ada756c7984 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sat, 6 Feb 2016 22:59:09 +0100 Subject: [PATCH] beautifying --- sample.md | 21 +++++++++++---------- src/parser.c | 3 ++- src/viewer.c | 5 ++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/sample.md b/sample.md index 6e70ab8..44bd450 100644 --- a/sample.md +++ b/sample.md @@ -82,11 +82,11 @@ C program starts with `main()`. -> # Supported markdown formatting <- -Code blocks are automatically detected by 4 -spaces at the beginning of a line. +Code blocks are automatically detected by 4 spaces +at the beginning of a line. -Tabs are automatically expanded to 4 spaces -while parsing the input. +Tabs are automatically expanded to 4 spaces while +parsing the input. \ int main(int argc, char \*argv[]) { \ printf("%s\\n", "Hello world!"); @@ -102,9 +102,9 @@ becomes -> # Supported markdown formatting <- -You can also use [pandoc](http://pandoc.org/demo/example9/pandocs-markdown.html)'s fenced code block extension. -Use at least three ~ chars to open and at least as many or -more ~ for closing. +You can also use [pandoc](http://pandoc.org/demo/example9/pandocs-markdown.html)'s fenced code block +extension. Use at least three ~ chars to open and +at least as many or more ~ for closing. \~~~ {.numberLines} \int main(int argc, char \*argv[]) { @@ -120,7 +120,8 @@ int main(int argc, char \*argv[]) { } ~~~~~~~~~~~~~~~~~~ -Pandoc attributes (like ".numberlines" etc.) will be ignored +Pandoc attributes (like ".numberlines" etc.) +will be ignored ------------------------------------------------- @@ -160,8 +161,8 @@ _some_ *highlighted* _*text*_ -> # Supported markdown formatting <- Backslashes force special markdown characters -like *\**, *\_*, *#* and *>* to be printed as normal -characters. +like *\**, *\_*, *#* and *>* to be printed as +normal characters. \\\*special\\\* diff --git a/src/parser.c b/src/parser.c index cbe46b1..9d8e2ef 100644 --- a/src/parser.c +++ b/src/parser.c @@ -89,7 +89,8 @@ deck_t *markdown_load(FILE *input) { slide = next_slide(slide); sc++; - } else if(CHECK_BIT(bits, IS_TILDE_CODE) && CHECK_BIT(bits, IS_EMPTY)) { + } else if(CHECK_BIT(bits, IS_TILDE_CODE) && + CHECK_BIT(bits, IS_EMPTY)) { // remove tilde code markers (text->reset)(text); diff --git a/src/viewer.c b/src/viewer.c index 0e8204f..ea33584 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -93,11 +93,10 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert, int reloa while(line && line->text) { - if (line->text->value) + if (line->text->value) { lc += url_count_inline(line->text->value); - - if (line->text->value) line->length -= url_len_inline(line->text->value); + } if(line->length > COLS) { i = line->length; -- 2.20.1