a couple more bug fixes

This commit is contained in:
2025-11-05 21:09:44 -07:00
parent 8a3d02fbec
commit c7ea4c529a
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -258,7 +258,7 @@ func (ht *htmlCheckerImpl) emitRune(ch rune, filters []outputFilter, countCols b
if len(filters) > 0 { if len(filters) > 0 {
// try each output filter to see what we can do // try each output filter to see what we can do
for _, of := range filters { for _, of := range filters {
handled = of.tryOutputRune(ht.outputBuffer, ch) handled = of.tryOutputRune(&ht.outputBuffer, ch)
if handled { if handled {
break // found a filter to handle it, done break // found a filter to handle it, done
} }
@@ -314,7 +314,7 @@ func (ht *htmlCheckerImpl) emitString(str string, filters []outputFilter, countC
// one of the output filters stopped us, try invoking it // one of the output filters stopped us, try invoking it
tmpch, bsiz := utf8.DecodeRuneInString(temp[outputLen:]) tmpch, bsiz := utf8.DecodeRuneInString(temp[outputLen:])
outputLen += bsiz outputLen += bsiz
if !stopper.tryOutputRune(ht.outputBuffer, tmpch) { if !stopper.tryOutputRune(&ht.outputBuffer, tmpch) {
ht.outputBuffer.WriteRune(tmpch) ht.outputBuffer.WriteRune(tmpch)
} }
if realCountCols { if realCountCols {
+2 -2
View File
@@ -13,7 +13,7 @@ import "strings"
// outputFilter is the interface for an HTML checker output filter. // outputFilter is the interface for an HTML checker output filter.
type outputFilter interface { type outputFilter interface {
tryOutputRune(strings.Builder, rune) bool tryOutputRune(*strings.Builder, rune) bool
matchRune(rune) bool matchRune(rune) bool
lengthNoMatch(string) int lengthNoMatch(string) int
} }
@@ -34,7 +34,7 @@ type htmlEncodingFilter struct{}
const htmlEscapedChars = "<>&" const htmlEscapedChars = "<>&"
// tryOutputRune outputs a rune that needs to be escaped. // tryOutputRune outputs a rune that needs to be escaped.
func (f *htmlEncodingFilter) tryOutputRune(buf strings.Builder, ch rune) bool { func (f *htmlEncodingFilter) tryOutputRune(buf *strings.Builder, ch rune) bool {
switch ch { switch ch {
case '<': case '<':
buf.WriteString("&lt;") buf.WriteString("&lt;")
+3 -3
View File
@@ -56,7 +56,7 @@
<div> <div>
<label for="title" class="block text-black text-sm font-medium mb-2">New topic name:</label> <label for="title" class="block text-black text-sm font-medium mb-2">New topic name:</label>
<input type="text" id="title" name="title" size="37" maxlength="128" <input type="text" id="title" name="title" size="37" maxlength="128"
value="{{ topicName }}" required placeholder="Enter a descriptive topic name..." value="{{ topicName | raw }}" required placeholder="Enter a descriptive topic name..."
class="w-full px-3 py-2 border border-gray-300 rounded font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> class="w-full px-3 py-2 border border-gray-300 rounded font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div> </div>
@@ -64,7 +64,7 @@
<div> <div>
<label for="pseud" class="block text-black text-sm font-medium mb-2">Your name/header:</label> <label for="pseud" class="block text-black text-sm font-medium mb-2">Your name/header:</label>
<div class="flex items-center gap-4"> <div class="flex items-center gap-4">
<input type="text" id="pseud" name="pseud" size="37" maxlength="255" value="{{ pseud }}" <input type="text" id="pseud" name="pseud" size="37" maxlength="255" value="{{ pseud | raw }}"
class="flex-1 px-3 py-2 border border-gray-300 rounded font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> class="flex-1 px-3 py-2 border border-gray-300 rounded font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<input type="checkbox" id="attach" name="attach" value="Y" <input type="checkbox" id="attach" name="attach" value="Y"
@@ -84,7 +84,7 @@
</div> </div>
<textarea id="pb" name="pb" wrap="soft" rows="7" cols="51" <textarea id="pb" name="pb" wrap="soft" rows="7" cols="51"
placeholder="Enter your message here. HTML tags are supported..." placeholder="Enter your message here. HTML tags are supported..."
class="w-full px-3 py-2 border border-gray-300 rounded font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">{{ pb }}</textarea> class="w-full px-3 py-2 border border-gray-300 rounded font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">{{ pb | raw }}</textarea>
</div> </div>
<!-- Action Buttons --> <!-- Action Buttons -->