ostream_write_str (stream->destination, "<span class=\"");
ostream_write_str (stream->destination, classname);
- ostream_write_str (stream->destination, ">");
+ ostream_write_str (stream->destination, "\">");
}
stream->last_class_stack_size = stream->curr_class_stack_size;
}
char inbuffer[BUFFERSIZE];
size_t inbufcount;
- emit_pending_spans (stream, true);
-
inbufcount = stream->buflen;
if (inbufcount > 0)
memcpy (inbuffer, stream->buf, inbufcount);
nbytes = u8_mbtouc (&uc, (const unsigned char *) inptr, insize);
- switch (uc)
+ if (uc == '\n')
{
- case '"':
- ostream_write_str (stream->destination, """);
- break;
- case '&':
- ostream_write_str (stream->destination, "&");
- break;
- case '<':
- ostream_write_str (stream->destination, "<");
- break;
- case '>':
- /* Needed to avoid "]]>" in the output. */
- ostream_write_str (stream->destination, ">");
- break;
- case ' ':
- /* Needed because HTML viewers merge adjacent spaces and
- drop spaces adjacent to <br> and similar. */
- ostream_write_str (stream->destination, " ");
- break;
- case '\n':
- {
- size_t prev_class_stack_size = stream->curr_class_stack_size;
- stream->curr_class_stack_size = 0;
- emit_pending_spans (stream, false);
- ostream_write_str (stream->destination, "<br/>");
- stream->curr_class_stack_size = prev_class_stack_size;
- }
- break;
- default:
- if (uc >= 0x20 && uc < 0x7F)
- {
- /* Output ASCII characters as such. */
- char bytes[1];
- bytes[0] = uc;
- ostream_write_mem (stream->destination, bytes, 1);
- }
- else
+ size_t prev_class_stack_size = stream->curr_class_stack_size;
+ stream->curr_class_stack_size = 0;
+ emit_pending_spans (stream, false);
+ ostream_write_str (stream->destination, "<br/>");
+ stream->curr_class_stack_size = prev_class_stack_size;
+ }
+ else
+ {
+ emit_pending_spans (stream, true);
+
+ switch (uc)
{
- /* Output non-ASCII characters in #&nnn; notation. */
- char bytes[32];
- sprintf (bytes, "&#%d;", uc);
- ostream_write_str (stream->destination, bytes);
+ case '"':
+ ostream_write_str (stream->destination, """);
+ break;
+ case '&':
+ ostream_write_str (stream->destination, "&");
+ break;
+ case '<':
+ ostream_write_str (stream->destination, "<");
+ break;
+ case '>':
+ /* Needed to avoid "]]>" in the output. */
+ ostream_write_str (stream->destination, ">");
+ break;
+ case ' ':
+ /* Needed because HTML viewers merge adjacent spaces
+ and drop spaces adjacent to <br> and similar. */
+ ostream_write_str (stream->destination, " ");
+ break;
+ default:
+ if (uc >= 0x20 && uc < 0x7F)
+ {
+ /* Output ASCII characters as such. */
+ char bytes[1];
+ bytes[0] = uc;
+ ostream_write_mem (stream->destination, bytes, 1);
+ }
+ else
+ {
+ /* Output non-ASCII characters in #&nnn;
+ notation. */
+ char bytes[32];
+ sprintf (bytes, "&#%d;", uc);
+ ostream_write_str (stream->destination, bytes);
+ }
+ break;
}
- break;
}
inptr += nbytes;