Start with some kramdown markdown:
{:.custom}
* this is the start of a list
This is the output:
\begin{itemize} % class="custom"
\item this is the start of a list
\end{itemize} % class="custom"
Now run these regex filters on it:
(?# Find:)
^\ *\\begin\{\w+?\}.*%[ |\t]+class="(\w+?)".*?\n
(?# Replace:)
\\begin{\1}\n
(?# Find:)
^\ *\\end\{\w+?\}.*%[ |\t]+class="(\w+?)".*?\n
(?# Replace:)
\\end{\1}\n
Final Result.text
\begin{custom}
\item this is the start of a list
\end{custom}
Good for styling using custom environments. Enables semantic tagging in markdown.
Use case: cases where you want to write markdown once and output to multiple formats (html, latex) while keeping special formatting based on defined classes. For example, creation of a codebook or technical manual.