From b80b2e4f9914f55ac9928c5d32f73d72243cf764 Mon Sep 17 00:00:00 2001 From: Dan Turkel Date: Tue, 4 Apr 2017 15:31:36 -0400 Subject: [PATCH] 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 = { "Grayscale": 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. --- docs/examples/layers-control/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/layers-control/index.md b/docs/examples/layers-control/index.md index 99098f7e..cfcbc36d 100644 --- a/docs/examples/layers-control/index.md +++ b/docs/examples/layers-control/index.md @@ -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:
var baseMaps = {
-	"Grayscale": grayscale,
+	"<span style='color: gray'>Grayscale</span>": grayscale,
 	"Streets": streets
 };