david parsons
b52ec440d4
strip out MKD_STRICT as a single flag (convert it into a composite flag that turns off a whole bunch of extensions); use that flagbit to disable github checkbox items, strip out MKD_DLIST as a single flag (convert it into a mask of MKD_DLDISCOUNT|MKD_DLEXTRA, and rework pgm_options so that 'strict' and 'relaxed' apply only to emphasis and 'standard' is the flag that sets & clears flags to make it closer to the standard. Version 3 because I'm fucking with the published interface
2019-04-14 20:56:55 -07:00
david parsons
0d33c8fe0d
tweak how scalar headers are include in .in files
2019-02-27 12:10:35 -08:00
david parsons
50c628197f
yank the repeated inline uncaches out and stuff them into a local function
2019-02-10 09:51:56 -08:00
david parsons
5577a536b4
deal with cached text before handling fenced code blocks
2019-02-10 09:47:10 -08:00
david parsons
4fba9d82a9
push the fencedcode block handler up to the toplevel scanner so it will handle blank lines inside the fence
2019-01-29 17:46:10 -08:00
david parsons
7fdc188f07
clean up all references to flags; define them EVERYWHERE as mkd_flag_t
2018-09-18 08:25:27 -07:00
david parsons
b002a5a4db
when splitting a line, null terminate the new line; also don't inherit the dle from the previous line
2018-05-26 13:57:35 -07:00
david parsons
faad80e95a
check for [x] & [X]
2018-04-17 21:07:39 -07:00
david parsons
a12d7d7294
take a pass at github checklist items
2018-04-17 18:09:33 -07:00
david parsons
5701d743c5
strip out a nextblank loop in favor of a call to nextblank
2018-03-14 21:04:56 -07:00
david parsons
b73576c20e
generalize __mkd_header_dle() into __mkd_trim_line() [trim N characters off the front of a line, adjust the dle] then use it instead of the pair CLIP/firstnonblank to trim & adjust dle
2018-03-10 10:33:57 -08:00
david parsons
6ac7f5ccf3
implement the m-e behavior of allowing full markdown inside m-e footnotes
2018-03-09 21:15:49 -08:00
david parsons
6e95a936d7
move the code to gather up the lines in a m-e footnote into its own subroutine
2018-03-09 18:55:16 -08:00
david parsons
fd48cc7885
tweak m-e footnotes to do blocks of text
2018-03-08 12:11:39 -08:00
david parsons
6e52af8dd8
Add in paranoid list splitting (the default behavior many many versions
...
ago before I realized it wasn't the standard) (and take the last of the
32-bit flag mask for it) between adjacent ordered and unordered lists.
2017-03-08 02:32:37 -08:00
david parsons
b39005d43d
Add a 'dirty' flag to the Document structure & set it whenever a callback
...
changes (github issue #136 ) so that the next mkd_compile will regenerate
the document.
2017-01-28 15:48:00 -08:00
david parsons
9d6a4a9636
Process html block in compile (as well as in compile_document();
...
compile_document() needs to handle <style> blocks and compile() needs to
handle html blocks that are nested inside blockquotes, tables, lists, &tc.
2017-01-26 15:42:33 -08:00
david parsons
b40018e9e9
Clean up the indentation in fencedcodeblock()
2017-01-26 15:33:14 -08:00
david parsons
d4b85ccf0c
More brute-force casting to discourage sign extension
2016-09-21 13:24:51 -07:00
david parsons
1c594226a0
Continuing with the horrible comment block kludgery :-(
2016-02-13 11:45:56 -08:00
david parsons
d658ae6990
Semi-revert the commentblock changes, then horribly kludge in a patch
...
that reenables them (memory corruption on freebsd 7.2 at program end
w new code; check control flow!)
2016-02-13 11:31:53 -08:00
david parsons
058820ed9d
Redo comment block handling; standard markdown only treats comments as
...
block html if the start comment marker starts at the beginning of a line
and the end comment marker is at the end of a line.
2016-02-13 09:39:26 -08:00
david parsons
ccffec0319
When attempting to match the closing tag of an html block, don't
...
advance the match index unless that character actually matches.
(defect: `<p></>*` was splitting into 2 lines when it should have
generated `<p><p></>*</p>`)
2016-02-02 20:31:40 -08:00
david parsons
7f169f4abf
EXPERIMENT: if mkd_compile() is called multiple times, actually recompile the document if the flags change.
2015-11-01 22:00:58 -08:00
Nathan Phillip Brink
088b5ab628
Convert --with-fenced-code to runtime flag for issue #124 .
...
This change is more invasive and difficult for me as not all existing
preprocessor directives directly translate to `if () {}`.
Instead of passing `--with-fenced-code` to `configure.sh`, now use
`MKD_FENCEDCODE` or `-ffencedcode`.
The output of `markdown -VV` will now display `FENCEDCODE` if the
feature is enabled and `!FENCEDCODE` if it is disabled rather than
displaying `FENCED-CODE` if the feature is enabled.
2015-07-13 03:24:30 +00:00
Nathan Phillip Brink
811a8560dd
Convert --with-dl to runtime flags for issue #124 .
...
Instead of specifying `./configure.sh --with-dl=both`, specify
`-fdlextra` or `MKD_DLEXTRA` at runtime.
2015-07-13 03:24:29 +00:00
david parsons
46e147599f
FINALLY address the bug where m-e footnotes lose numbering when
...
they show up in nested element; I was not carrying the m-e reference#
inside the footnotes structure, but was instead carrying it in the
parent structure and not updating it. So I changed the footnotes structure
to include the reference + the list of footnotes, which made the misnumbering
go away on my tests.
2015-01-18 12:12:28 -08:00
david parsons
4de75a3026
Tweak the #ifdefs for fenced code blocks so that if they aren't
...
enabled they aren't enabled ANYWHERE.
2014-08-07 23:37:54 -07:00
david parsons
196a7aea97
Revert changes that somehow worked their way into the code (patch
...
applied on github that was not pulled to the master. Grr.)
2014-01-22 02:11:17 -08:00
david parsons
4a6407e080
Strip out C++ comments that came from a merge
2013-10-22 09:43:36 -07:00
George Hartzell
f771134ffe
Fix handling for long numeric list item tags (e.g. "10000. foo")
...
Fixing thise required two changes
10000. When you've discovered an enumerated list item with a long
identifier set clip to the length of the identifier so that it
all gets trimmed off properly.
42. When you're looking for additional paragraphs to include with that
item use the standard indent of 4, not the crazy long ident you
used to trim the identifier.
Add a test for this case.
Fix another test for which the old code generated some whitespace
(which doesn't change the way the page looks in a browser but which
futzed up the exact matching in the test).
2013-10-16 20:56:31 -07:00
Loren Segal
8290ab9c0d
Support dashes & underscores in lang name.
...
Also allow lang name to be spaced after fence.
2013-07-04 08:54:04 -07:00
Loren Segal
87d6e711cd
Support language attr on fenced code block line
...
The following syntax should now be valid:
```lang
CODE HERE
```
And generates:
<pre><code class="lang">CODE HERE
</code></pre>
This syntax allows support for GitHub Flavored Markdown style
fenced code blocks used on [GitHub][1].
[1]: https://help.github.com/articles/github-flavored-markdown
2013-06-29 17:03:44 -07:00
david parsons
7c95d1fbd1
Tweak divquote handling so that two adjacent divquotes won't
...
die if there is a space between the second > & leading %
2013-02-05 20:17:25 -08:00
david parsons
108ce626c0
Strip out some debugging output
2012-08-08 20:37:52 -07:00
david parsons
67a6cd94bd
Screwed up the #ifdef around fenced code detection in checkline
2012-08-08 20:35:54 -07:00
david parsons
be8ab7a1dc
Add support for backtick fenced code blocks
2012-08-07 23:25:56 -07:00
david parsons
f34f9a1f51
Add the new option MKD_NOSTYLE, which disables special handling
...
of style blocks and treats them like plain old html.
2012-08-05 20:30:45 -07:00
david parsons
a8810a6e5c
Be paranoid; check to see if S(t->text) before looking at T(t->text)
2012-03-07 08:40:21 -08:00
david parsons
6eacbc931b
I macro if(e) into if( (e) ) if gcc or clang are detected
2012-01-24 09:53:51 -08:00
david parsons
d09db0993c
Rework the table detector logic so that it checks regular markup blocks.
2011-09-25 23:29:31 -07:00
david parsons
990076f657
Change text blocking; the reference version doesn't split code off from text
2011-07-28 18:26:18 -07:00
david parsons
f4f322d8dc
Code block fences need to be 3 or more tildes
2011-07-22 10:08:58 -07:00
david parsons
78db997a4b
Support pandoc-style fenced code blocks with nested lines of tildes
2011-07-22 09:58:01 -07:00
david parsons
18b6508bb2
Clean up (for some values of "clean up") the end of text block detection code
2011-07-21 23:36:51 -07:00
david parsons
2fd979bdc4
Add a configuration check to see if the inline keyword is defined.
...
If it's defined, use it on a bunch of small static functions that
are used a lot.
2011-07-21 23:16:49 -07:00
david parsons
92226dfb60
Why check flags & CHECKED in checkline() when I'm already checking it before calling?
2011-07-21 13:03:47 -07:00
david parsons
7cb4476220
Add a paranoia check to fencedcodeblock() -- don't check for a fence on null lines
2011-07-20 23:47:31 -07:00
david parsons
4274dcf06b
Tweak fencedcodeblock() so it ignores empty fences and non-terminated fences
2011-07-20 23:16:33 -07:00
david parsons
6871b93371
Wrap fenced code blocks inside a configure option.
2011-07-20 18:44:57 -07:00