diff --git a/markdown.dtx b/markdown.dtx index d8fdb598c..bac1aa983 100644 --- a/markdown.dtx +++ b/markdown.dtx @@ -22691,11 +22691,34 @@ M.extensions = {} % % \end{markdown} % \begin{macrocode} -M.extensions.bracketed_spans = function() +M.extensions.bracketed_spans = function(self) return { name = "built-in bracketed_spans syntax extension", - extend_writer = function() - end, extend_reader = function() + extend_writer = function(self) +% \end{macrocode} +% \par +% \begin{markdown} +% +% Define \luamdef{writer->span} as a function that will transform an input +% bracketed span `s` to the output format. +% +% \end{markdown} +% \begin{macrocode} + function self.span(s) + return {"\\markdownRendererBracketedSpan{",s,"}"} + end + end, extend_reader = function(self) + local parsers = self.parsers + local writer = self.writer + + local Span = parsers.between(parsers.Inline, + parsers.lbracket, + parsers.rbracket) + * parsers.attributes + / writer.span + + self.insert_pattern("Inline after Emph", + Span, "Span") end } end