Commit Graph
219 Commits
Author SHA1 Message Date
david parsons 4a73e7f7d6 have all of the extensions code guarded by checking against MKD_STRICT 2022-10-05 12:22:28 -07:00
david parsons 066d0ed47c I had a variable defined in the middle of a block, which is a C nocando. 2022-06-18 01:22:16 -07:00
david parsons 74f6bd9b49 checkline was still having problems with properly detecting fenced code blocks 2022-04-11 14:25:12 -07:00
david parsons 0137688a6b clean up fenced code marker detection 2022-04-11 09:53:53 -07:00
david parsons 543628f9f4 the toplevel compilation pass needs to back out of an unclosed bit of fenced code 2022-04-08 23:54:20 -07:00
david parsons 6c1d704075 tweak the fenced code disaster 2022-04-08 23:18:24 -07:00
david parsons 1321a22ecd first pass at collapsing fenced code blocks into regular paragraphs 2022-04-07 22:36:36 -07:00
david parsons 0571211c84 I wasn't properly uniqifying the top level of compiled fragments for toc labels 2022-03-28 10:18:11 -07:00
david parsons 343845b66d rework the whole TOC uniquifier so it only runs at the end of a compilation; put code in (#ifdeffed out) to recursively uniquify names if I ever decide to throw a wider net when generating a TOC 2022-03-23 16:08:07 -07:00
david parsons 599617843e implement a toc label uniquifier 2022-03-22 17:01:14 -07:00
david parsons 29fd434453 restructure the dd accumulator in definition_block() so that the goto isn't *quite* so horribly an abuse of block structure 2020-04-08 01:21:56 -07:00
david parsons c5ea5bbadf redo the mkd_flag_t set functions to more closely fit how I'm using them and to have more descriptive names 2019-12-08 09:39:23 -08:00
david parsons fd801c6951 don't COPY_FLAGS null flags; just initialize to 0s 2019-12-08 08:16:22 -08:00
david parsons b9e867b574 redo the whole flags dealie as an opaque blob 2019-12-07 22:49:52 -08:00
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