Mike Rockett Posted January 3, 2017 Share Posted January 3, 2017 As I mentioned in this issue, I've create a new textformatter for ParsedownExtraPlugin, which adds some oomph to your markdown. Repo: Parsedown Extra Plugin Unlike the built-in textformatter for Parsedown and Parsedown Extra, this should be used when you want to use Extra with additional configuration/customisation. Some examples: ### Test {.heading} - A [external link](https://google.com/){.google} with `google` as a class that opens in a new tab if the config property is set. - [Another link](/page){target=_blank} that opens in a new tab even though it isn't external. ```html .html <p>Test</p> ``` There's some config options available to you, such as setting attributes on all/external images and links, setting table and table-cell alignment classes, adjusting footnote classes and IDs, adding <code> attributes to their parent <pre> elements, and changing the <code> class if your syntax highlighter does not use language-*. I was thinking about adding the ability to make links open in a new tab by appending a plus to the link syntax, but only external links should be opening in a new tab anyway. Further, this would add extra, unnecessary processing time. Please let me know if you bump into any problems. ☺️ 4 Link to comment Share on other sites More sharing options...
owzim Posted January 3, 2017 Share Posted January 3, 2017 The additional settings will be very useful, thanks. The core inclusion of Parsedown and your module renders my module from 2014 redundant. I'll take it off. 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted January 3, 2017 Author Share Posted January 3, 2017 @owzim - You're most welcome. Yeah, I think those who write markdown should be able to configure the output, making it somewhat less opinionated. Hadn't actually seen your module - surely the core textformatter would have rendered yours redundant? Link to comment Share on other sites More sharing options...
Mike Rockett Posted September 30, 2017 Author Share Posted September 30, 2017 Libs updated, bumped to 1.0.0 stable. 2 Link to comment Share on other sites More sharing options...
Mike Rockett Posted September 24, 2018 Author Share Posted September 24, 2018 Module has been moved to GitLab. https://gitlab.com/rockettpw/tools/parsedown-extra-plugin 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted March 9, 2019 Author Share Posted March 9, 2019 1.0.1 released with three new options: 1 Link to comment Share on other sites More sharing options...
70f Posted February 26, 2023 Share Posted February 26, 2023 Hi, I am applying this text formatter to a textarea field. When I output the content of the field with <?php $output = $page->note; ?> <?php echo $output; ?> in my template file, I get the following two warnings followed by the correctly formatted output. Warning: Trying to access array offset on value of type null in /home/<domain>/public_html/site/modules/TextformatterParsedownExtraPlugin/lib/ParsedownExtra.php on line 241 Warning: Trying to access array offset on value of type null in /home/<domain>/public_html/site/modules/TextformatterParsedownExtraPlugin/lib/ParsedownExtra.php on line 241 I have Processwire 3.0.210. The version of PHP in use is 8.0.20. The module settings are the defaults set when the module is installed, i.e. I've made no changes. Any idea why I get these warnings? Thanks, Nic Link to comment Share on other sites More sharing options...
asbjorn Posted May 12, 2023 Share Posted May 12, 2023 With PHP 8.2 I get this error: Deprecated: Use of "parent" in callables is deprecated in /**/site/modules/TextformatterParsedownExtraPlugin/lib/ParsedownExtraPlugin.php on line 94 Is this something that could be fixed in an update of the plugin? ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now