Escape html elements inside code sample (#5432)
The markup renderer will still literally render html tags inside "pre" and "code" unless they're escaped. The result was that the example code would be rendered as: var baseMaps = { "Grayscale": grayscale, "Streets": streets }; rather than var baseMaps = { "<span style='color: gray'>Grayscale</span>": grayscale, "Streets": streets }; because the "Grayscale" text would be literally styled as a span with gray color, and then recolored by the syntax highlighter. Escaping the span tags fixes this.
This commit is contained in:
parent
0abc67fdae
commit
b80b2e4f99
@ -63,7 +63,7 @@ Also note that when using multiple base layers, only one of them should be added
|
||||
Finally, you can style the keys when you define the objects for the layers. For example, this code will make the label for the grayscale map gray:
|
||||
|
||||
<pre><code>var baseMaps = {
|
||||
"<span style='color: gray'>Grayscale</span>": grayscale,
|
||||
"<span style='color: gray'>Grayscale</span>": grayscale,
|
||||
"Streets": streets
|
||||
};
|
||||
</code></pre>
|
||||
|
Loading…
Reference in New Issue
Block a user