|
A pretty printer for plain text, which acts as the fall back for QWeave when it can't find anything more specific.
#include <iostream> #include <string> #include <cstring> #include "qweave.hh"
|
static string s;
|
const string & pretty_print_text (const string &source) { string se; s = ""; for (unsigned int i = 0; i < source.size(); ++i) { char c = source[i]; if (c == '\n') s += use_html ? "\n" : "\n\\par\\tt{}"; else { format_text (c, se, true); s += se; } } return s; }