File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,11 @@ def __str__(self):
179
179
{content}
180
180
```\
181
181
"""
182
+ CodeBlockHTML_TPL = """\
183
+ <pre{attr}>
184
+ <code>{content}</code>
185
+ </pre>\
186
+ """
182
187
183
188
184
189
@dataclass
@@ -210,6 +215,21 @@ def __str__(self):
210
215
211
216
return CodeBlock_TPL .format (content = content , attr = attr )
212
217
218
+ @property
219
+ def html (self ):
220
+ """
221
+ Code (block) rendered as html
222
+
223
+ Notes
224
+ -----
225
+ Generates html as if the `--no-highlight` option as passed
226
+ to pandoc
227
+ """
228
+ content = self .content or ""
229
+ attr = f" { self .attr .html } " if self .attr else ""
230
+ return CodeBlockHTML_TPL .format (content = content , attr = attr )
231
+
232
+
213
233
214
234
@dataclass
215
235
class BulletList (Block ):
Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ def __str__(self):
136
136
def html (self ):
137
137
"""
138
138
Code (inline) rendered as html
139
+
140
+ Notes
141
+ -----
142
+ Generates html as if the `--no-highlight` option as passed
143
+ to pandoc
139
144
"""
140
145
content = self .text or ""
141
146
attr = f" { self .attr .html } " if self .attr else ""
You can’t perform that action at this time.
0 commit comments