Skip to content

Commit

Permalink
add underline support + todo at the beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
vtorri committed Jul 9, 2021
1 parent 924688e commit 4e2daab
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
51 changes: 50 additions & 1 deletion etui_md.c
Expand Up @@ -5,6 +5,53 @@

#include "etui_md.h"

/*
* TODO
*
* Blocks
*
* [X] doc
* [ ] quote
* [ ] ul
* [ ] ol
* [ ] li
* [ ] hr
* [X] h
* [X] code
* [ ] html
* [X] p
* [ ] table
* [ ] thead
* [ ] tbody
* [ ] tr
* [ ] th
* [ ] td
*
* Spans
*
* [X] em
* [X] strong
* [ ] a
* [ ] img
* [X] code
* [ ] del
* [ ] latexmath(display)
* [ ] wikilink
* [X] u
*
* Texts
*
* [X] normal
* [ ] nullchar
* [X] br
* [X] softbr
* [ ] entity
* [X] code
* [ ] html
* [ ] latexmath
*
* /
/*============================================================================*
* Local *
*============================================================================*/
Expand Down Expand Up @@ -362,6 +409,7 @@ _md_enter_span(MD_SPANTYPE type, void *detail, void *data)
break;
case MD_SPAN_U:
printf("underline\n");
evas_textblock_cursor_format_prepend(sd->cur, "+underline=single underline_color=#a0a0a0");
break;
}
fflush(stdout);
Expand Down Expand Up @@ -408,6 +456,7 @@ _md_leave_span(MD_SPANTYPE type, void *detail, void *data)
break;
case MD_SPAN_U:
printf("underline\n");
evas_textblock_cursor_format_prepend(sd->cur, "-");
break;
}
fflush(stdout);
Expand Down Expand Up @@ -519,7 +568,7 @@ void etui_md_file_set(Evas_Object *obj, const char *filename)

/* parse markdown file */
memset(&parser, 0, sizeof(parser));
parser.flags = MD_DIALECT_COMMONMARK;
parser.flags = MD_DIALECT_COMMONMARK | MD_FLAG_UNDERLINE;
parser.enter_block = _md_enter_block;
parser.leave_block = _md_leave_block;
parser.enter_span = _md_enter_span;
Expand Down
6 changes: 6 additions & 0 deletions underline.txt
Expand Up @@ -37,3 +37,9 @@ _foo _bar
.
<p>_foo _bar</p>
````````````````````````````````

Underline :

underline _test underline_ fin
italique *test italique* fin
gras **test gras *gras italique*** fin

0 comments on commit 4e2daab

Please sign in to comment.