【发布时间】:2015-10-18 19:03:03
【问题描述】:
我在Blogger 上使用SyntaxHighlighter。问题是在我的Python 代码 sn-p 中添加了 意外行。
代码包含在:
<pre class="brush:bash;">
...
</pre>
我的代码是:
(venv) dm@Z580:~/workspace/venv/greeter$ python
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from greeter import app
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dm/workspace/venv/greeter/greeter/app.py", line 7, in <module>
from effects.dashed import add_dashes
ImportError: No module named 'effects'
实际渲染的内容:
(venv) dm@Z580:~/workspace/venv/greeter$ python
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from greeter import app
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dm/workspace/venv/greeter/greeter/app.py", line 7, in <module>
from effects.dashed import add_dashes
ImportError: No module named 'effects'
</module></module></stdin>
所以最后一行</module></module></stdin> 被添加到输出中。
为什么会发生这种情况以及如何防止这种行为?
【问题讨论】:
标签: python blogger syntaxhighlighter