12345678910111213141516171819 |
- #pragma once
- namespace nall::Encode {
- inline auto HTML(const string& input) -> string {
- string output;
- for(char c : input) {
- if(c == '&' ) { output.append("&" ); continue; }
- if(c == '<' ) { output.append("<" ); continue; }
- if(c == '>' ) { output.append(">" ); continue; }
- if(c == '"' ) { output.append("""); continue; }
- if(c == '\'') { output.append("'"); continue; }
- output.append(c);
- }
- return output;
- }
- }
|