Browse Source
Originally code blocks simply output this: <pre><code>the code block text></code></pre> However that sometimes led to unsatisfying formatting with some browsers (especially text ones) and so that was ultimately changed to this: <div><dl></dl><pre><code>code block text</code></pre></div> The div then additionally has a class to facilitate formatting with a style sheet. The empty <dl></dl> causes agents that would otherwise make a poor formatting choice to do "the right thing"(tm) instead. However, the "<dl></dl>" kludge is unsatisfying for a number of reasons. Instead output this: <div><pre></pre><pre><code>code block text</code></pre></div> where the first div still has a class to facilitate formatting via a style sheet, but the replacement "<pre></pre>" block has an embedded style and is actually emitted like so: <pre style="display:none"></pre> While this is still a kludge, it's much more satisfying because: 1. The same element type is being used to force those recalictrant text agents to do "the right thing"(tm). 2. The explict style="display:none" attribute completely protects properly behaving agents from any unwanted side-effects from the extra "<pre></pre>" tag pair. Together with this change, the --stub stylesheet has also been modified to use a more universally (i.e. page background is not white) compatible styling for the code blocks themselves. Signed-off-by: Kyle J. McKay <mackyle@gmail.com>master
Kyle J. McKay
8 years ago
1 changed files with 13 additions and 6 deletions
Loading…
Reference in new issue