summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--README.md21
2 files changed, 23 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 449369f..f8edbad 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@
* Allow escape sequences in style IDs, style names and CSS class names.
+* Allow a separator to be specified when HTML elements are collapsed.
+
* Add include_embedded_style_map argument to allow embedded style maps to be
disabled.
diff --git a/README.md b/README.md
index acece48..9a7ec13 100644
--- a/README.md
+++ b/README.md
@@ -526,6 +526,27 @@ Modifiers must be used in the correct order:
h1.section-title:fresh
```
+#### Separators
+
+To specify a separator to place between the contents of paragraphs that are collapsed together,
+use `:separator('SEPARATOR STRING')`.
+
+For instance, suppose a document contains a block of code where each line of code is a paragraph with the style `Code Block`.
+We can write a style mapping to map such paragraphs to `<pre>` elements:
+
+```
+p[style-name='Code Block'] => pre
+```
+
+Since `pre` isn't marked as `:fresh`,
+consecutive `pre` elements will be collapsed together.
+However, this results in the code all being on one line.
+We can use `:separator` to insert a newline between each line of code:
+
+```
+p[style-name='Code Block'] => pre:separator('\n')
+```
+
#### Nested elements
Use `>` to specify nested elements.