shithub: riscv

Download patch

ref: 8dc8e3a0198f9127c3d48aa2e079ac078aec73e3
parent: 33231f9222486b50e7cfe621fb41a4b7e32e47c1
author: Kristo <kristo.ilmari@gmail.com>
date: Sat Jan 22 13:00:22 EST 2022

mothra: fix rendering of <samp> tag
Mothra does not currently render text inside <samp> tags inline
similar to <code>, but instead treats them like <pre> which is actually
incorrect behavior. The following small patch should fixes issue.


--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -982,6 +982,7 @@
 			g.state->size=NORMAL;
 			break;
 		case Tag_code:
+		case Tag_samp:
 			g.state->font=CWIDTH;
 			g.state->size=NORMAL;
 			break;
@@ -1113,7 +1114,6 @@
 		case Tag_xmp:
 			htmlerror(g.name, g.lineno, "<%s> deprecated", tag[g.tag].name);
 		case Tag_pre:
-		case Tag_samp:
 			g.state->indent=0;
 			g.state->pre=1;
 			g.state->font=CWIDTH;
@@ -1203,7 +1203,6 @@
 		case Tag_listing:
 		case Tag_menu:
 		case Tag_ol:
-		case Tag_samp:
 		case Tag_title:
 		case Tag_ul:
 		case Tag_xmp: