aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/mdwn.pm
Commit message (Collapse)AuthorAge
* Fix inverted footnote config with MultiMarkdown.Amitai Schleier2019-09-04
| | | | | | Bug spotted and fix from Giuseppe Bilotta <giuseppe.bilotta@gmail.com>. Extend mdwn tests to cover MultiMarkdown, where applicable.
* mdwn: Automatically detect which libdiscount flags to useSimon McVittie2018-03-08
| | | | | | | | | | Unconditionally passing arbitrary numbers as flags turns out to be a bad idea, because some of the "unused" values have historically had side-effects internal to libdiscount. Detect whether the known flags work by rendering short Markdown snippets the first time we htmlize, checking whether each known flag is both necessary and sufficient. Signed-off-by: Simon McVittie <smcv@debian.org>
* mdwn: Restore historical behaviourSimon McVittie2018-01-29
| | | | | | | | | | | | | | | The Discount package in Debian historically enabled fenced code blocks, PHP Markdown Extra-style definition lists, and an expanded character set for tag names. Since Discount 2.2.0 those are runtime settings, so enable them. Unfortunately Text::Markdown::Discount doesn't yet expose the necessary constants: https://rt.cpan.org/Public/Bug/Display.html?id=124188 The IDANCHOR option was historically also enabled in Debian, but is not enabled here because ikiwiki does not enable the TOC option, and IDANCHOR does nothing without TOC. Closes: #888055
* mdwn: Don't enable alphabetically labelled ordered lists by defaultSimon McVittie2017-05-16
| | | | | | | | | | | This avoids misinterpreting initials ("C. S. Lewis was an author"), the abbreviation for Monsieur ("M. Descartes was a philosopher") and German page numbering ("S. 42") as ordered lists if they happen to begin a line. This only affects the default Discount implementation: Text::Markdown and Text::MultiMarkdown do not have this feature anyway. A new mdwn_alpha_list option can be used to restore the old interpretation.
* mdwn: Enable footnotes by default when using DiscountSimon McVittie2017-05-14
| | | | | A new mdwn_footnotes option can be used to disable footnotes in MultiMarkdown and Discount.
* mdwn: Don't mangle <style> into <elyts> under some circumstancesSimon McVittie2017-05-14
| | | | | We can ask libdiscount not to elide <style> blocks, which means we don't have to work around them.
* mdwn: Make flags passed to libdiscount explicitSimon McVittie2017-05-14
| | | | | | The Perl binding defaults to MKD_NOHEADER|MKD_NOPANTS anyway, but making them explicit means we can use other flags of our choice, and makes it easier to justify why those flags are appropriate.
* Process .md like .mdwn, but disallow web creation.Amitai Schlair2016-03-08
|
* protect $@ whenever a block using $@ is non-trivialSimon McVittie2014-02-21
| | | | | | | | | | | | | | | | | | | | | | | | As noted in the Try::Tiny man page, eval/$@ can be quite awkward in corner cases, because $@ has the same properties and problems as C's errno. While writing a regression test for definetemplate in which it couldn't find an appropriate template, I received <span class="error">Error: failed to process template <span class="createlink">deftmpl</span> </span> instead of the intended <span class="error">Error: failed to process template <span class="createlink">deftmpl</span> template deftmpl not found</span> which turned out to be because the "catch"-analogous block called gettext before it used $@, and gettext can call define_gettext, which uses eval. This commit alters all current "catch"-like blocks that use $@, except those that just do trivial things with $@ (string interpolation, string concatenation) and call a function (die, error, print, etc.)
* fix the nodiscount settingJoey Hess2012-01-23
|
* mdwn: Added nodiscount setting, which can be used to avoid using the ↵Joey Hess2012-01-16
| | | | markdown discount engine, when maximum compatability is needed.
* Workaround discount's eliding of <style> blocks.Joey Hess2012-01-15
|
* workaround a bug in the discount perl bindingJoey Hess2012-01-01
| | | | | Empty input, or input consisting soley of whitespace caused an uninitialized value warning.
* discount supportJoey Hess2012-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mdwn: Can use the discount markdown library, via the Text::Markdown::Discount perl module. This is preferred if available since it's the fastest currently supported markdown library, speeding up markdown rendering by a factor of 40. That is to say, when only rendering a lot of markdown, discount is 40x faster. When building a ikiwiki site, ikiwiki's other overhead gets in the way, but I still see significant speedups. Building the ikiwiki docwiki dropped from 62 to 45 seconds, for example. However, when multimarkdown is enabled, Text::Markdown::Multimarkdown is still used. While discount contains some nonstandard markdown extensions, including tables and footnotes, AFAICS most of them are not enabled by default in the perl bindings. I consider sticking to non-extended markdown a desirable thing, since this is probably not the last markdown engine. In particular, sundown is waiting in the wings to get packaged and get a perl binding. ---- Reviewing all the showdown extensions, here are the ones that are enabled: centered paragraphs: ->centered<- image sizes: [dust mite](http://dust.mite =150x150) <style>..</style> blocks are eaten. The perl binding does not provide access to the gathered CSS. This is not legal html anyway, so unlikely to cause breakage.
* format plugin categorizationJoey Hess2010-02-12
|
* Group related plugins into sections in the setup file, and drop unused rcs ↵Joey Hess2010-02-11
| | | | plugins from the setup file.
* mdwn: Avoid trying to use multimarkdown if it is not installed.Joey Hess2009-10-26
|
* add a long name for mdwn ("Markdown")Jon Dowland2009-05-16
|
* finalise version 3.00 of the plugin apiJoey Hess2008-12-23
|
* Coding style change: Remove explcit vim folding markers.Joey Hess2008-12-17
|
* add plugin safe/rebuild info (part 1 of 2)Joey Hess2008-08-03
| | | | too many plugins.. brain exploding..
* remove default values in getsetupJoey Hess2008-07-26
| | | | | They were a bit confusing, since they did not actually set the default, and example values are sufficient.
* turn booleans into questionsJoey Hess2008-07-26
|
* add getsetupJoey Hess2008-07-25
| | | | | Also, avoid dying with a fatal error if multimarkdown is enabled and the module doesh't load.
* mdwn: Add a multimarkdown setup file option.Joey Hess2008-05-13
|
* test for Text::Markdown::[Mm]arkdown and use the available oneJoey Hess2008-03-04
| | | | | | | | | | Markdown is such a splintered mess.. The current debian package provides only Text::Markdown::Markdown, while all versions of Text::Markdown support Text::Markdown::markdown, and old versions also support the capitalised version, while new ones don't. It's getting to the point where `grep /markdown/i %symbol_table` is the only sane way to figure out what function to call..
* * Use Text::Markdown::markdown, since version 1.0.16 of Text::MarkdownJoey Hess2008-03-04
| | | | | no longer supports Text::Markdown::Markdown. All old versions of Text::Markdown also support the lower-case version.
* not only markdown adds gunk, so remove it in the main htmlize functionJoey Hess2008-01-09
|
* * mdwn: When htmlizing text, if it's a single line with no newline,Joey Hess2008-01-09
| | | | | | remove the enclosing paragraph and newline markdown wraps it in. This allows removing several hacks around this markdown behavior from other plugins that htmlize fragements of pages.
* * Improve workaround for perl bug #376329. Rather than double-encoding,Joey Hess2007-11-27
| | | | | | | which has been reported to cause encoding problems (though I haven't reproduced them), just catch a failure of markdown, and retry. (The crazy perl bug magically disappears on the retry.) Closes: #449379
* * pagespec_match() has changed to take named parameters, to better allowjoey2007-04-27
| | | | | | | | | for extended pagespecs. The old calling convention will still work for back-compat for now. * The calling convention for functions in the IkiWiki::PageSpec namespace has changed so they are passed named parameters. * Plugin interface version increased to 2.00 since I don't anticipate any more interface changes before 2.0.
* * Initial work on internationalization of the program code. po/ikiwiki.potjoey2006-12-29
| | | | | is available for translation. * Export gettext() from IkiWiki module.
* oops...joey2006-09-16
|
* * Support Text::Markdown from CPAN, which has a different interface fromjoey2006-09-16
| | | | the original markdown or the one in Debian.
* * Deal with CPAN installing Markdown as Text::Markdown, while it's joey2006-09-16
| | | | installed as just Markdown by apt.
* * Work on firming up the plugin interface:joey2006-09-09
| | | | | | | | | | | | | | | | | | | - Plugins should not need to load IkiWiki::Render to get commonly used functions, so moved some functions from there to IkiWiki. - Picked out the set of functions and variables that most plugins use, documented them, and made IkiWiki export them by default, like a proper perl module should. - Use the other functions at your own risk. - This is not quite complete, I still have to decide whether to export some other things. * Changed all plugins included in ikiwiki to not use "IkiWiki::" when referring to stuff now exported by the IkiWiki module. * Anyone with a third-party ikiwiki plugin is strongly enrouraged to make like changes to it and avoid use of non-exported symboles from "IkiWiki::". * Link debian/changelog and debian/news to NEWS and CHANGELOG. * Support hyperestradier version 1.4.2, which adds a new required phraseform setting.
* * Change htmlize, format, and sanitize hooks to use named parameters.joey2006-08-28
|
* * Improve markdown loading. First, try to load it as a properl perl module,joey2006-08-10
| | | | | | | in case it was installed as one. Then fall back to trying /usr/bin/markdown. * Document in install page how to install markdown, since it has no installation procedure in the upstream tarball.
* * Display an error message if /usr/bin/markdown can't be loaded.joey2006-08-10
|
* * Support htmlize plugins and make mdwn one such plugin, which is enabled byjoey2006-07-03
default (of course!). Based on a patch by Faidon Liambotis.