before
+ d.append(pre); // move into
+});
+```
+::::
+
+We can cross-reference @lst:example.
+````
+
+```{css, echo = FALSE}
+[id^="lst:"] code[class] { background-color: inherit; }
```
-Note that we also added the ID (`#blk:example`) to the fenced Div to make it the
+Note that we also added the ID (`#lst:example`) to the fenced Div to make it the
target of the cross reference, i.e., when you click on the reference, the
browser will navigate to the Div.
For HTML output, we can style the numbers and references with CSS. Element
numbers are wrapped in ``, and references are
wrapped in ``, where `*` is the ID prefix
-(e.g., `fig`, `tab`, and `eqn`). For example, we can add the label "Block" to
+(e.g., `fig`, `tab`, and `eqn`). For example, we can add the label "Listing" to
the number and reference of the block above:
```{css}
-.ref-number-blk::before, .cross-ref-blk::before {
- content: "Block ";
+.ref-number-lst::before, .cross-ref-lst::before {
+ content: "Listing ";
}
-.ref-number-blk {
+.ref-number-lst {
font-style: italic;
}
-.ref-number-blk::after {
+.ref-number-lst::after {
content: ". "
}
```
diff --git a/inst/resources/default.css b/inst/resources/default.css
index ba276e0..72f6527 100644
--- a/inst/resources/default.css
+++ b/inst/resources/default.css
@@ -15,7 +15,7 @@ pre { white-space: pre-wrap; word-break: break-word; }
pre code { display: block; padding: 1em; overflow-x: auto; }
code { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }
:not(pre) > code, code[class], .box > .caption { background-color: #f8f8f8; }
-pre > code:not([class]), pre > .language-plain, .box { background-color: inherit; border: 1px solid #eee; }
+pre > code:is(:not([class]), .language-plain, .language-none), .box { background-color: inherit; border: 1px solid #eee; }
pre > .message { border-color: #9eeaf9; }
pre > .warning { background: #fff3cd; border-color: #fff3cd; }
pre > .error { background: #f8d7da; border-color: #f8d7da; }