discount3/README.md
2025-12-13 01:28:21 +04:00

47 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# lua-discount3 Markdown
[Lua] bindings for the [Discount] [Markdown] library version >3.0.
Fork of Craig Barnes archive: https://github.com/craigbarnes/lua-discount
Jessica (ex- David) L. Parsons wrote (https://www.pell.portland.or.us/~orc/Code/discount/downloads.html):
```
I ran out of slots in the original bitmap flags structure, so I dumped it and replaced it with a new flag blob accessed through a flag pointer. This broke the entire published interface and required the update to version 3 (this is why it took me over 3 years to implement it; I needed to test the code to within an inch of its life and between that and transitioning it just ate up time like you wouldnt believe!)
Because I changed the mkd_flag_t structure and replaced it with a blob, the old flags are now a pointer and using the mkd_flag_isset(), mkd_set_flag(), and mkd_clr_flag() functions I introduced during the end of the run for version 2.x.x is now mandatory unless youre fond of core dumps.
The way Id originally implemented HTML5 (if thats even a thing anymore?) support was to have a global structure that I allocated once and then you were stuck with it forever (and had to deallocate the structure whenever you stopped using the library otherwise it would leak memory), so I fixed that for v3.0.0 by moving the html5 details inside the MMIOT (activated by setting the flag MKD_HTML5) so it will automatically be deallocated when you are done with a document without affecting other MMIOTs.
```
Here is the implementation of bindings for discount v3 API.
## Install
```
luarocks install discount3
```
## Troubleshooting
If you get a compilation error during installation, it's because discount isn't installed as a shared library. See the solution here: https://gitlabor.ru/Datenlabor/discount
License
-------
ISC [License][] (SPDX: [`ISC`]).
[Lua]: https://www.lua.org/
[Discount]: http://www.pell.portland.or.us/~orc/Code/discount/
[Markdown]: https://en.wikipedia.org/wiki/Markdown
[License]: LICENSE
[`ISC`]: https://spdx.org/licenses/ISC.html