("langmap_dir"));
highlighter.setGenerateEntireDoc(false);
highlighter.setGenerateLineNumbers(true);
#if defined(NDEBUG)
highlighter.setOptimize(true);
#else
highlighter.setOptimize(false);
#endif
highlighter.setCanUseStdOut(false);
highlighter.setTabSpaces(4);
highlighter.setStyleCssFile("sh_darkness.css");
highlighter.setGenerateLineNumbers(false);
std::string processed_pastie;
if (m_syntax_highlight) {
//TODO: redirect to "pastie not found" if !pastie
processed_pastie = std::move(*pastie);
}
else {
Escapist houdini;
std::ostringstream oss;
oss << R"()";
oss << houdini.escape_html(*pastie) << "
\n";
processed_pastie = oss.str();
}
if (not m_plain_text and m_syntax_highlight) {
std::istringstream iss(std::move(processed_pastie));
std::ostringstream oss;
highlighter.highlight(iss, oss, m_lang_file);
processed_pastie = oss.str();
}
parContext["pastie"] = std::move(processed_pastie);
}
std::string PastieResponse::on_mustache_retrieve() {
if (m_plain_text)
return "{{pastie}}";
else
return load_mustache();
}
} //namespace tawashi