'''python{line-numbers}
<code here>
'''
# first process codeblocks
for idx, line in enumerate(mdlines):
if line.count('<!--') > 0 and not incodeblock:
incomment = not incomment
if line.count('-->') > 0 and not incodeblock:
incomment = not incomment
leavingcomment = True
if line.count('```') == 1: # on a fence
incodeblock = not incodeblock
if not incodeblock:
leavingcodeblock = True
onfence = True
else:
onfence = False
# open fence: ```language{option option}
if onfence and not leavingcodeblock:
language = line.strip('`').split('{')[0]
options = line.replace('```' + language, '').replace('{', '').replace('}', '').split()
prismopts = ''
mdlines[idx] = '```' + language
for option in options:
opt = option.strip().split('=')[0]
if opt == 'line-numbers':
prismopts = 'class="line-numbers"'
needenddivcode = True
if prismopts:
mdlines[idx] = '<style>\npre {\n line-height: 1 !important;\n}\n</style>\n' + mdlines[idx]
print(':', idx, line, language, options, 'div' in mdlines[idx])
This is the . And
This is the [!__BETA_CTA CTA Test](https://www.adobe.com)
Foo
Anim aute ex elit qui duis qui et pariatur cillum nisi Lorem fugiat amet. Aliquip duis ut laborum tempor. Cupidatat velit est dolor fugiat Lorem ipsum velit ex velit mollit. Ut laborum cupidatat mollit eiusmod in sunt reprehenderit quis sunt irure consectetur et ex Lorem. Lorem anim laboris mollit id labore dolore.
Simple one-liner:
console.log('Hello World!')
Easy Peasy!
print('Hello World\n')