diff --git a/novelwriter/core/tohtml.py b/novelwriter/core/tohtml.py
index a9ba0bb7..5805f240 100644
--- a/novelwriter/core/tohtml.py
+++ b/novelwriter/core/tohtml.py
@@ -52,6 +52,10 @@ HTML5_TAGS = {
Tokenizer.FMT_SUP_E: "",
Tokenizer.FMT_SUB_B: "",
Tokenizer.FMT_SUB_E: "",
+ Tokenizer.FMT_DL_B: "",
+ Tokenizer.FMT_DL_E: "",
+ Tokenizer.FMT_ADL_B: "",
+ Tokenizer.FMT_ADL_E: "",
Tokenizer.FMT_STRIP: "",
}
@@ -431,6 +435,8 @@ class ToHtml(Tokenizer):
styles.append(".break {text-align: left;}")
styles.append(".synopsis {font-style: italic;}")
styles.append(".comment {font-style: italic; color: rgb(100, 100, 100);}")
+ styles.append(".dialog {color: rgb(174, 0, 0);}")
+ styles.append(".altdialog {color: rgb(66, 113, 174);}")
return styles
diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm
index abcaa5f4..04b56dae 100644
--- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm
+++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm
@@ -19,6 +19,8 @@ mark {background: rgb(255, 255, 166);}
.break {text-align: left;}
.synopsis {font-style: italic;}
.comment {font-style: italic; color: rgb(100, 100, 100);}
+.dialog {color: rgb(174, 0, 0);}
+.altdialog {color: rgb(66, 113, 174);}
diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json
index 8eac4a6b..f59579d2 100644
--- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json
+++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json
@@ -2,8 +2,8 @@
"meta": {
"projectName": "Lorem Ipsum",
"novelAuthor": "lipsum.com",
- "buildTime": 1716803284,
- "buildTimeStr": "2024-05-27 11:48:04"
+ "buildTime": 1718032228,
+ "buildTimeStr": "2024-06-10 17:10:28"
},
"text": {
"css": [
@@ -20,7 +20,9 @@
".keyword {color: rgb(245, 135, 31); font-weight: bold;}",
".break {text-align: left;}",
".synopsis {font-style: italic;}",
- ".comment {font-style: italic; color: rgb(100, 100, 100);}"
+ ".comment {font-style: italic; color: rgb(100, 100, 100);}",
+ ".dialog {color: rgb(174, 0, 0);}",
+ ".altdialog {color: rgb(66, 113, 174);}"
],
"html": [
[
diff --git a/tests/test_core/test_core_tohtml.py b/tests/test_core/test_core_tohtml.py
index 8a4a54ab..9e150295 100644
--- a/tests/test_core/test_core_tohtml.py
+++ b/tests/test_core/test_core_tohtml.py
@@ -24,6 +24,7 @@ import json
import pytest
+from novelwriter import CONFIG
from novelwriter.core.project import NWProject
from novelwriter.core.tohtml import ToHtml
@@ -260,6 +261,28 @@ def testCoreToHtml_ConvertParagraphs(mockGUI):
"Europe\n"
)
+ # Dialogue
+ html.setDialogueHighlight(True)
+ html._text = "## Chapter\n\nThis text \u201chas dialogue\u201d in it.\n\n"
+ html.tokenizeText()
+ html.doConvert()
+ assert html.result == (
+ "Chapter
\n"
+ "This text \u201chas dialogue\u201d in it.
\n"
+ )
+
+ # Alt. Dialogue
+ CONFIG.altDialogOpen = "::"
+ CONFIG.altDialogClose = "::"
+ html.setDialogueHighlight(True)
+ html._text = "## Chapter\n\nThis text :: has alt dialogue :: in it.\n\n"
+ html.tokenizeText()
+ html.doConvert()
+ assert html.result == (
+ "Chapter
\n"
+ "This text :: has alt dialogue :: in it.
\n"
+ )
+
# Footnotes
# =========