Skip to content

{ Monthly Archives } May 2020

Extending Parsedown: attributes

Markdown Extra (including Parsedown Extra) allows for attributes to be applied to certain elements: headers, fenced code blocks, links, and images. I'd like to be able to apply them to any element. I'm going to use the syntax of Python Markdown attributes, but the attribute lists go before the elements. For block level elements, they […]

Extending Parsedown: Block elements

Continuing work on extending Parsedown. See the actual code. Adding block-level elements is not much different from adding inline elements. Kavanot.name originally used <footer> elements to indicate the source of a block quote: <blockquote> Do or do not. There is no try. </blockquote> <footer>Yoda</footer> </blockquote> While marking blockquotes this way is now acceptable, for a […]

Extending Parsedown: Inline elements

Extending Parsedown involves adding elements to the $InlineTypes and $BlockTypes arrays, then adding methods to handle them. See the actual code. Italics I use <i> a lot, to indicate transliterated words. So I use could use "/" to indicate that: /Shabbat/ is a Hebrew word becomes <i>Shabbat</i> is a Hebrew word. To do that: do […]

String Replacement in PHP

Working with Parsedown, I want to string manipulation but only in certain parts. For instance, on text not in HTML tags or not in quotes. The right way to do that is with a real parser. The easy way is by removing the unwanted strings, replacing them with a marker that won't come up in […]

Extending Parsedown

I've been spending all my intellectual free time on working on my Kavanot site, so I haven't been doing any independent programming. But that site uses raw HTML, which is a pain to type. So I decided to start using Markdown to make writing easier. After a little trial and error, I decided to use […]