summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-10-20 17:39:30 -0400
committerJune McEnroe <june@causal.agency>2021-10-20 17:39:30 -0400
commitc7b458887737f33a0b21c1ab35854072eec795e8 (patch)
treed925053729c189a1fb805f1d9ca161b5510eb2b1
parentRun shotty after ptee in up -t (diff)
downloadsrc-c7b458887737f33a0b21c1ab35854072eec795e8.tar.gz
src-c7b458887737f33a0b21c1ab35854072eec795e8.zip
Only output style attribute if necessary
Diffstat (limited to '')
-rw-r--r--bin/shotty.l5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/shotty.l b/bin/shotty.l
index e9edb515..8018d785 100644
--- a/bin/shotty.l
+++ b/bin/shotty.l
@@ -493,7 +493,8 @@ static void span(const struct Cell *prev, const struct Cell *cell) {
 			if (fg < 8) fg += 8;
 			attr &= ~Bold;
 		}
-		printf(Q(<span class="bg%d fg%d" style=) "\"", bg, fg);
+		printf(Q(<span class="bg%d fg%d"), bg, fg);
+		if (attr || colors) printf(" style=\"");
 		if (attr & Bold) printf("font-weight:bold;");
 		if (attr & Italic) printf("font-style:italic;");
 		if (attr & Underline) printf("text-decoration:underline;");
@@ -503,7 +504,7 @@ static void span(const struct Cell *prev, const struct Cell *cell) {
 				Palette[bg], Palette[fg]
 			);
 		}
-		printf("\">");
+		printf("%s>", (attr || colors ? "\"" : ""));
 	}
 	switch (cell->ch) {
 		break; case L'&': printf("&amp;");
b8&follow=1'>Generate index.atomJune McEnroe 2020-04-26Generate XHTML content in Atom entriesJune McEnroe 2020-04-25Style index pageJune McEnroe 2020-04-25Render index.htmlJune McEnroe 2020-04-25Wrap <summary> replies count in <data>June McEnroe 2020-04-25Accumulate thread envelopes before concatenationJune McEnroe 2020-04-24Free envelope in concatDataJune McEnroe 2020-04-24Use replyTo address in mailto:June McEnroe 2020-04-23Wrap quoted lines in <q>June McEnroeting.pyPřemysl Janouch Previously the script tried to encode output from Pygments with the ASCII codec, which failed. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Add a suggestion to the manpagePřemysl Janouch So that people wishing to use "enable-http-clone" don't have to find out the correct settings on their own. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix the example configurationPřemysl Janouch "enable-git-clone" doesn't exist, replaced with "enable-http-clone". Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix about-formatting.shPřemysl Janouch dash failed to parse the script. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix some spelling errorsPřemysl Janouch Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Hubertsgmsg'> WTF why did no one tell me about this? 2020-02-27Style %T outside of Rs in italicJune McEnroe 2020-02-26Add Fierce Femmes and Notorious LiarsJune McEnroe 2020-02-23Add This Is How You Lose the Time WarJune McEnroe 2020-02-22Add See Ya LaterJune McEnroe 2020-02-20Remove wiki scriptJune McEnroe Wikipedia seems to have removed the one-sentence extracts from the opensearch results. Too bad. It's not a wiki script, what we need is a command that fetches single-sentence summaries of articles on Wikipedia. 2020-02-19Add The Obelisk GateJune McEnroe 2020-02-17Add Four Tet — HandsJune McEnroe One from the cafe that caught my attention. 2020-02-12Simplify macOS notify-sendJune McEnroe 2020-02-12Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe Wow. One of the best I've read. 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe Broke out LDLIBS for each bin, and made everything more uniform. 2020-01-28Change scout sensitivity to 1.4June McEnroe idk it seems to work. 2020-01-28Import shows.txtJune McEnroe