mirror of
https://github.com/szymon-jozef/static-site-generator.git
synced 2026-09-07 12:10:42 +02:00
12 lines
325 B
C++
12 lines
325 B
C++
#include "markdown/markdown.hpp"
|
|
#include <string>
|
|
|
|
static bool replace_once(std::string &str, const std::string &from,
|
|
const std::string &to) {
|
|
size_t start_pos = str.find(from);
|
|
if (start_pos == std::string::npos)
|
|
return false;
|
|
str.replace(start_pos, from.length(), to);
|
|
return true;
|
|
}
|