From e02ca762755e6fd22e8c642982948c725a2c5e38 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Fri, 4 Dec 2015 14:06:18 +0100 Subject: [PATCH] Don't rely on cmark internals The cmark_node struct and the node.h header are private. --- lib/Markup/Markup.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/Markup/Markup.cpp b/lib/Markup/Markup.cpp index 985e526116191..b49e2a5b98ad1 100644 --- a/lib/Markup/Markup.cpp +++ b/lib/Markup/Markup.cpp @@ -16,7 +16,6 @@ #include "swift/Markup/LineList.h" #include "swift/Markup/Markup.h" #include "cmark.h" -#include "node.h" using namespace llvm; using namespace markup; @@ -60,15 +59,7 @@ StringRef getLiteralContent(MarkupContext &MC, LineList &LL, cmark_node *Node) { // its parent. auto Literal = cmark_node_get_literal(Node); assert(Literal != nullptr); - size_t Length = 0; - switch (cmark_node_get_type(Node)) { - case CMARK_NODE_CODE_BLOCK: - Length = Node->as.code.literal.len; - break; - default: - Length = Node->as.literal.len; - } - return MC.allocateCopy(StringRef(Literal, Length)); + return MC.allocateCopy(StringRef(Literal)); } ParseResult