-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
The html that is generated when including source code, e.g.:
```python
for i in range(10):
print(f'{i=}')
```
references an external CSS. Here is inspect of the code generated for the above:
However, such code will not keep the formatting when copied and pasted into an interactive editor like Microsoft Outlook Web Interface or GMail. To keep the syntax highlightening it is necessary to embed the formatting inline in the html.
Here is an example of html with embedded formatting which in contrast can be copied into both Microsoft Outlook Web Interface and GMail:
<span style="color:#a020f0;">for i <span style="color:#a020f0;">in <span style="color:#483d8b;">range(10):
<span style="color:#483d8b;">print(f<span style="color:#008b00;">'{i=}')
</span></span></span></span></span>
Note that there are offline tools that can do such embedding, e.g. the python https://pypi.org/project/premailer/. But it would obviously be much easier to do copy paste of the stackedit generated html if no such postprocessing is necessary.