Skip to content

Commit 2451d06

Browse files
committed
Merge pull request #209 from nwellnhof/cmark
Don't rely on cmark internals
2 parents 98230e6 + e02ca76 commit 2451d06

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/Markup/Markup.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "swift/Markup/LineList.h"
1717
#include "swift/Markup/Markup.h"
1818
#include "cmark.h"
19-
#include "node.h"
2019

2120
using namespace llvm;
2221
using namespace markup;
@@ -60,15 +59,7 @@ StringRef getLiteralContent(MarkupContext &MC, LineList &LL, cmark_node *Node) {
6059
// its parent.
6160
auto Literal = cmark_node_get_literal(Node);
6261
assert(Literal != nullptr);
63-
size_t Length = 0;
64-
switch (cmark_node_get_type(Node)) {
65-
case CMARK_NODE_CODE_BLOCK:
66-
Length = Node->as.code.literal.len;
67-
break;
68-
default:
69-
Length = Node->as.literal.len;
70-
}
71-
return MC.allocateCopy(StringRef(Literal, Length));
62+
return MC.allocateCopy(StringRef(Literal));
7263
}
7364

7465
ParseResult<MarkupASTNode>

0 commit comments

Comments
 (0)