nene / guider

A guides engine extracted out of JSDuck
GNU General Public License v3.0
1 stars 1 forks source link

<pre><code> code formatting #17

Closed branflake2267 closed 11 years ago

branflake2267 commented 11 years ago

I'd like to manually implement the prettify code formatting, but seems something odd happens when I add the code. The ending pre tag gets moved down the page. Not sure if some regex form the mark down editor is causing this.

<pre class="prettyprint linenums">
<code class="language-java">
listStore.addStoreRemoveHandler(new StoreRemoveHandler<Stock>() {
  @Override
  public void onRemove(StoreRemoveEvent<Stock> event) {
  }
});
</code>
</pre>

Screen Shot 2013-03-21 at 9 53 58 AM

nene commented 11 years ago

Using the <pre> tag manually is not really a great idea, as then you need to escape the HTML characters inside code manually. Like writing StoreRemoveHandler&lt;Stock&gt;.

branflake2267 commented 11 years ago

Is that b/c of the markdown parser?

nene commented 11 years ago

Yes. The Markdown parser just looks at this as a blob of HTML and doesn't do any processing on it. This happens within any block-level HTML element.