This revision was automatically updated to reflect the committed changes. Closed by commit rL367137: [clang-format] Fix style of css file paths (authored by DiegoAstiazaran, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D65309?vs=211971&id=211972#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65309/new/ https://reviews.llvm.org/D65309 Files: clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp Index: clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp +++ clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp @@ -110,34 +110,23 @@ ClangDocContext CDCtx = getClangDocContext(); auto Err = G->generateDocForInfo(&I, Actual, CDCtx); assert(!Err); - SmallString<16> PathToF; - llvm::sys::path::native("../../../path/to/F.html", PathToF); - SmallString<16> PathToInt; - llvm::sys::path::native("../int.html", PathToInt); - SmallString<16> PathToSylesheet; - llvm::sys::path::native("../../../clang-doc-default-stylesheet.css", - PathToSylesheet); std::string Expected = R"raw(<!DOCTYPE html> <meta charset="utf-8"/> <title>class r</title> -<link rel="stylesheet" href=")raw" + - std::string(PathToSylesheet.str()) + - R"raw("/> +<link rel="stylesheet" href="../../../clang-doc-default-stylesheet.css"/> <div> <h1>class r</h1> <p>Defined at line 10 of test.cpp</p> <p> Inherits from - <a href=")raw" + std::string(PathToF.str()) + - R"raw(">F</a> + <a href="../../../path/to/F.html">F</a> , G </p> <h2>Members</h2> <ul> <li> private - <a href=")raw" + std::string(PathToInt.str()) + - R"raw(">int</a> + <a href="../int.html">int</a> X </li> </ul> Index: clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp =================================================================== --- clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp +++ clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp @@ -231,6 +231,8 @@ SmallString<128> StylesheetPath = computeRelativePath("", InfoPath); llvm::sys::path::append(StylesheetPath, llvm::sys::path::filename(FilePath)); + // Paths in HTML must be in posix-style + llvm::sys::path::native(StylesheetPath, llvm::sys::path::Style::posix); LinkNode->Attributes.try_emplace("href", StylesheetPath); Out.emplace_back(std::move(LinkNode)); }
Index: clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp +++ clang-tools-extra/trunk/unittests/clang-doc/HTMLGeneratorTest.cpp @@ -110,34 +110,23 @@ ClangDocContext CDCtx = getClangDocContext(); auto Err = G->generateDocForInfo(&I, Actual, CDCtx); assert(!Err); - SmallString<16> PathToF; - llvm::sys::path::native("../../../path/to/F.html", PathToF); - SmallString<16> PathToInt; - llvm::sys::path::native("../int.html", PathToInt); - SmallString<16> PathToSylesheet; - llvm::sys::path::native("../../../clang-doc-default-stylesheet.css", - PathToSylesheet); std::string Expected = R"raw(<!DOCTYPE html> <meta charset="utf-8"/> <title>class r</title> -<link rel="stylesheet" href=")raw" + - std::string(PathToSylesheet.str()) + - R"raw("/> +<link rel="stylesheet" href="../../../clang-doc-default-stylesheet.css"/> <div> <h1>class r</h1> <p>Defined at line 10 of test.cpp</p> <p> Inherits from - <a href=")raw" + std::string(PathToF.str()) + - R"raw(">F</a> + <a href="../../../path/to/F.html">F</a> , G </p> <h2>Members</h2> <ul> <li> private - <a href=")raw" + std::string(PathToInt.str()) + - R"raw(">int</a> + <a href="../int.html">int</a> X </li> </ul> Index: clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp =================================================================== --- clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp +++ clang-tools-extra/trunk/clang-doc/HTMLGenerator.cpp @@ -231,6 +231,8 @@ SmallString<128> StylesheetPath = computeRelativePath("", InfoPath); llvm::sys::path::append(StylesheetPath, llvm::sys::path::filename(FilePath)); + // Paths in HTML must be in posix-style + llvm::sys::path::native(StylesheetPath, llvm::sys::path::Style::posix); LinkNode->Attributes.try_emplace("href", StylesheetPath); Out.emplace_back(std::move(LinkNode)); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits