From 47e3257963cb8b2bac1fb94973adb57a82975a7e Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 28 Jan 2023 09:04:36 +0100 Subject: [PATCH] Get rid of shadowing even if the shadowing there is probably the safer solution --- src/Utils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 3a989215..d8313688 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -718,15 +718,17 @@ process_spoilers(cmark_node *node) continue; std::string_view next_content = cmark_node_get_literal(next); - if (auto posEnd = next_content.find("||"); posEnd != std::string_view::npos) { + if (auto posEndNext = next_content.find("||"); + posEndNext != std::string_view::npos) { // We found the end of the spoiler std::string before_spoiler = std::string(content.substr(0, posStart)); - std::string after_spoiler = std::string(next_content.substr(posEnd + 2)); + std::string after_spoiler = + std::string(next_content.substr(posEndNext + 2)); std::string inside_spoiler_start = std::string(content.substr(posStart + 2)); std::string inside_spoiler_end = - std::string(next_content.substr(0, posEnd)); + std::string(next_content.substr(0, posEndNext)); std::string spoiler_text = extract_spoiler_warning(inside_spoiler_start);