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:
Dan Turkel 2017-04-04 15:31:36 -04:00 committed by Per Liedman
parent 0abc67fdae
commit b80b2e4f99

View File

@ -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,
"&lt;span style='color: gray'&gt;Grayscale&lt;/span&gt;": grayscale,
"Streets": streets
};
</code></pre>