mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-08-19 13:29:49 +00:00
Temporary hack to remove html tags that are causing problems.
I will add the comment back in as as separate mustache token. And I will make this code look a bit nicer.
This commit is contained in:
parent
2bc671280e
commit
e978d87b16
1 changed files with 8 additions and 1 deletions
|
@ -36,6 +36,13 @@ namespace kamokan {
|
||||||
//TODO: make sure the file exists or throw or do something
|
//TODO: make sure the file exists or throw or do something
|
||||||
return parSettings.as<std::string>("highlight_css");
|
return parSettings.as<std::string>("highlight_css");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string strip_tags_from_highlighted (const std::string& parPastie) {
|
||||||
|
boost::string_view pastie(parPastie);
|
||||||
|
auto beg_stripped = pastie.substr(pastie.find("<tt>") + 4);
|
||||||
|
auto end_stripped = beg_stripped.substr(0, beg_stripped.size() - 11);
|
||||||
|
return std::string(end_stripped);
|
||||||
|
}
|
||||||
} //unnamed namespace
|
} //unnamed namespace
|
||||||
|
|
||||||
PastieResponse::PastieResponse (
|
PastieResponse::PastieResponse (
|
||||||
|
@ -100,7 +107,7 @@ namespace kamokan {
|
||||||
std::istringstream iss(std::move(processed_pastie));
|
std::istringstream iss(std::move(processed_pastie));
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
highlighter.highlight(iss, oss, m_lang_file);
|
highlighter.highlight(iss, oss, m_lang_file);
|
||||||
processed_pastie = oss.str();
|
processed_pastie = strip_tags_from_highlighted(oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return processed_pastie;
|
return processed_pastie;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue