Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不要な std::format の利用を削除 #161

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/syntax/FootnoteDefinition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ struct FootnoteDefinition : public ASTNode {
std::string label = "label_" + symbol;
std::string jump_to = "ref_" + symbol;

return std::format(
"<span class=\"footnote-def\" id=\"{}\"><a "
"href=\"#{}\">[{}]</a>{}</span>",
label, jump_to, symbol, childs_html);
return "<span class=\"footnote-def\" id=\"" + label + "\"><a href=\"#" +
jump_to + "\">[" + symbol + "]</a>" + childs_html + "</span>";
}
std::map<std::string, std::string> get_properties() const override {
return {{"symbol", symbol}};
Expand Down
10 changes: 4 additions & 6 deletions src/syntax/InlineFootnoteReference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ struct InlineFootnoteReference : public ASTNode {
}

std::string to_html() const override {
// This is correct.
// This is correct.
// `label_` is setted in `FootnoteDefinition` (which we have to jump to)
std::string label = "ref_" + symbol;
std::string jump_to = "label_" + symbol;

return std::format(
"<span class=\"footnote-ref\"><sup id=\"{}\"><a "
"href=\"#{}\">[{}]</a>"
"</sup></span>",
label, jump_to, symbol);
return "<span class=\"footnote-ref\"><sup id=\"" + label +
"\"><a href=\"#" + jump_to + "\">[" + symbol +
"]</a></sup></span>";
}

std::map<std::string, std::string> get_properties() const override {
Expand Down