about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--default.html6
-rw-r--r--html.c22
2 files changed, 24 insertions, 4 deletions
diff --git a/default.html b/default.html
index 7059e61..9190086 100644
--- a/default.html
+++ b/default.html
@@ -98,6 +98,12 @@ pre q::before, pre q::after {
 pre q {
 	color: navy;
 }
+pre q q {
+	color: teal;
+}
+pre q q q {
+	color: purple;
+}
 pre del {
 	text-decoration: none;
 	color: red;
diff --git a/html.c b/html.c
index ee9e966..12f3ff0 100644
--- a/html.c
+++ b/html.c
@@ -253,6 +253,23 @@ static int htmlMarkupURLs(FILE *file, char *buf) {
 	return escapeXML(file, ptr);
 }
 
+static int htmlMarkupQuote(FILE *file, char *buf) {
+	int error;
+	size_t level = 0;
+	for (char *ch = buf; *ch == '>' || *ch == ' '; level += (*ch++ == '>'));
+	for (size_t i = 0; i < level; ++i) {
+		error = templateRender(file, TEMPLATE(<q>), NULL, NULL);
+		if (error) return error;
+	}
+	error = htmlMarkupURLs(file, buf);
+	if (error) return error;
+	for (size_t i = 0; i < level; ++i) {
+		error = templateRender(file, TEMPLATE(</q>), NULL, NULL);
+		if (error) return error;
+	}
+	return 0;
+}
+
 static int htmlMarkup(FILE *file, const char *content) {
 	int error = 0;
 	size_t cap = 0;
@@ -299,10 +316,7 @@ static int htmlMarkup(FILE *file, const char *content) {
 		} else if (patch) {
 			error = escapeXML(file, buf);
 		} else if (buf[0] == '>') {
-			error = 0
-				|| templateRender(file, TEMPLATE(<q>), NULL, NULL)
-				|| htmlMarkupURLs(file, buf)
-				|| templateRender(file, TEMPLATE(</q>), NULL, NULL);
+			error = htmlMarkupQuote(file, buf);
 		} else {
 			error = htmlMarkupURLs(file, buf);
 		}
as input "pending", showing an indicator. 2022-02-20Show indicator in status when window has pending inputJune McEnroe 2022-02-20Use separate edit buffers for each IDJune McEnroe 2022-02-20Make sure new cap is actually larger than new lengthJune McEnroe 2022-02-20Remove unused mbs.len field from struct EditJune McEnroe 2022-02-19Remove unneeded includes in ui.cJune McEnroe 2022-02-19Reimplement tab completeJune McEnroe 2022-02-19Handle errors from editFn, etc.June McEnroe 2022-02-19Reimplement text macrosJune McEnroe 2022-02-19Factor out input handling to input.cJune McEnroe 2022-02-19Factor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe In other words, warn when a function is missing static. I don't see why this isn't in -Wextra. 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe I know, it feels wrong. 2022-02-18Implement new line editing "library"June McEnroe Losing tab complete and text macros, for now. This new implementation works on an instance of a struct and does not interact with the rest of catgirl, making it possible to copy into another project. Unlike existing line editing libraries, this one is entirely abstract and can be rendered externally. My goal with this library is to be able to implement vi mode. Since it operates on struct instances rather than globals, it might also be possible to give catgirl separate line editing buffers for each window, which would be a nice UX improvement. 2022-02-18Simplify cursor positioning in inputJune McEnroe Do some extra work by adding the portion before the cursor to the input window twice, but simplify the interaction with the split point. This fixes the awkward behaviour when moving the cursor across colour codes where the code would be partially interpreted up to the cursor. 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe