jessica parsons
8ddfb981ef
redo the html5 flag option to make it a per-MMIOT thing, instead of being a global block that we have to deallocate when we're done; also take the opportunity to clean up mkd_initmmiot to have it set fags & html5 extraflags instead of duplicating that code in three places
2025-09-03 17:26:21 -07:00
jessica parsons
61c748f021
add support for extended attributes on [] & ![] links
2025-08-30 01:09:53 -07:00
jessica parsons
6ff6878cfd
add support for % widths & heights for images (original implementation by mwfong-csl (on github); my implementation only because I couldn't figure out how to pull github patch requests into my master repository on pell)
2025-08-29 17:01:07 -07:00
david parsons
deca3b64b0
okay, the whole callback structure was a hot mess; change it so that every different callback has its own date & free function
2023-12-13 21:31:04 -08:00
david parsons
faa5150346
add the new runtime flag ALT_AS_TITLE; if an image has no title, use the alt text as the title
2023-02-21 11:03:12 -08:00
David Seifert
7afa5c6242
Make C99 clean
...
* Clang 16 (and likely GCC 14) will enforce strict C99 semantics
and break old K&R C declarations and require correct C89
function prototypes.
Bug: https://bugs.gentoo.org/870952
Clang: https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213/9
2022-10-27 11:08:49 -07:00
david parsons
37b22a997e
match the descriptions for MKD_STRICT in mkdio.h.in & markdown.h
2022-10-04 12:27:16 -07:00
david parsons
e12437122a
rolling in the v2.2.7c fix to tag behavior patch
2022-10-04 12:07:49 -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
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
Yuri Chornoivan
38282592fc
Fix minor typos
2020-05-01 19:58:40 +03:00
david parsons
dfb7e00281
start gluing up a v2 compatability layer
2019-12-15 21:08:36 -08:00
david parsons
e677e83165
update the header verification program so it works with the new flag format; cosmetically tweak mkdio.h.in & markdown.h to make it easier to automatically diff the two enums
2019-12-10 09:24:46 -08: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
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
866e9aaccb
support external code formatters
2019-04-10 11:59:04 -07:00
david parsons
ee2b955fd6
tweak configure to (a) use the modern standard uintXX_t types for DWORD, WORD, BYTE if possible and (b) if a program is defined via an environment variable (like CC) try to use that variable instead of doing a path search in AC_PROG
2019-02-27 11:56:21 -08:00
david parsons
1f90fde27f
add an anchor format callback, plus add the -x option to the markdown program to squash toc anchors to (close to) github compatability
2019-02-18 20:54:05 -08:00
david parsons
0308244ec8
shuffle around some of the definitions to make everything happily(?) compile with all instances of flags being mkd_flag_t
2018-09-18 08:32:03 -07: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
f555d4c1c4
fix all places where I pass flags to be DWORDs
2018-09-14 20:18:17 -07:00
david parsons
a12d7d7294
take a pass at github checklist items
2018-04-17 18:09:33 -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
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
f76c08670b
Tweak superscript handling to be able to superscript something wrapped in html
2017-01-28 11:45:20 -08:00
david parsons
11587f606e
Back out Paragraph->label (never actually implemented as a way
...
around collisions in TOC entries; I'm changing the anchor generator
so that it won't lose data as part of the text to anchor process.)
2016-12-31 22:07:18 -08:00
david parsons
8c3a149b10
Use \r instead of ^C for the internal hard end of line marker; \r
...
counts as whitespace so I dont have to do isspace() || is MKD_EOLN
2016-11-14 21:37:10 -08:00
david parsons
94e446c7c4
include "config.h" to pick up the definition of DWORD/WORD/BYTE (windows
...
support) & add a new label field for better TOC label generation
2016-05-27 22:22:00 -07:00
david parsons
f3681ccc8d
Eat one of the two remaining flag bits (64-bin flag_t, here we
...
come!) to make LaTeX support a runtime flag.
2016-05-21 21:58:50 -07:00
david parsons
6e4190fa65
Handle error conditions and pass errorcodes out of various mkd_xxx output function
...
(inspired by a patch written by Koen Punt <koen@koenpunt.nl >)
2015-10-26 14:43:54 -07:00
Nathan Phillip Brink
5da3388382
Convert urlencodedanchor to a runtime flag for issue #124 .
...
Instead of `./configure.sh --with-urlencoded-anchor`, now use
`-furlencodedanchor` or `MKD_URLENCODEDANCHOR`.
2015-07-13 03:24:31 +00:00
Nathan Phillip Brink
5790b66a4a
Make githubtags configurable at runtime for issue #124 .
...
Instead of `./configure.sh --with-github-tags`, specify `-fgithubtags`
or `MKD_GITHUBTAGS`. Shows up in `markdown -VV` as `GITHUBTAGS`
instead of `GITHUB-TAGS` now.
2015-07-13 03:24:31 +00:00
Nathan Phillip Brink
2ff7c1f41b
Convert compiletime ID Anchor setting to runtime flag for issue #124 .
...
Now specify flag `-fidanchor` or `MKD_IDANCHOR` instead of
`./configure.sh --with-id-anchor`. In `markdown -VV` displays as
`IDANCHOR` or `!IDANCHOR` rather than `ID-ANCHOR`.
2015-07-13 03:24:31 +00: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
d3d5afae55
Fix a bug where autolink + github flavored markdown absorbs the ^C eoln
...
character into a link at the end of a line.
2014-06-27 14:59:25 -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
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
f3231d5f9e
Add prototypes for the two gfm_...() input methods
2012-06-04 21:29:11 -07:00
david parsons
09945b7393
Create the gfm_string() method that does github flavoured markdown
...
on strings.
2012-05-31 22:37:58 -07:00
david parsons
66ac90e4b6
Add support for github flavoured markdown linebreaks (by adding new
...
functions that pad every input line with two spaces.)
2012-05-30 22:46:46 -07:00
david parsons
57ea29d87f
Add $LFLAGS to the build line for theme
2012-01-19 08:15:28 -08:00
david parsons
a6835ff673
There are half a dozen regular line patterns that I repeatedly scan for here;
...
pull them out into a separate function that looks for them and stores the
pattern types in the line structure, and then use that stored type instead
of scanning over and over again.
Also tweak the blockquote identifier to use the dle field instead of
hand-scanning across the leading whitespace.
2011-07-20 16:59:59 -07:00