Skip to content

Commit 301f776

Browse files
committed
Fixed: Do not randomly remove slashes from comments, fixes #656
1 parent 3317a76 commit 301f776

14 files changed

+13
-13
lines changed

dist/light/protobuf.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js.gz

-1 Bytes
Binary file not shown.

dist/minimal/protobuf.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.min.js.gz

0 Bytes
Binary file not shown.

dist/protobuf.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js.gz

1 Byte
Binary file not shown.

dist/protobuf.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tokenize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function tokenize(source) {
117117
.substring(start, end)
118118
.split(/\n/g);
119119
for (var i = 0; i < lines.length; ++i)
120-
lines[i] = lines[i].replace(/ *[*/]+ */, "").trim();
120+
lines[i] = lines[i].replace(/^ *[*/]+ */, "").trim();
121121
commentText = lines
122122
.join("\n")
123123
.trim();

tests/data/comments.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ message Test1 {
2020
// Field with no comment.
2121
uint32 field2 = 2;
2222

23-
bool field3 = 3; /// Field with a comment.
23+
bool field3 = 3; /// Field with a comment and a <a href="http://example.com/foo/">link</a>
2424
}
2525

2626
// Message

tests/docs_comments.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tape.test("proto comments", function(test) {
1313

1414
test.equal(root.lookup("Test1.field1").comment, "Field with a comment.", "should parse blocks for message fields");
1515
test.equal(root.lookup("Test1.field2").comment, null, "should not parse lines for message fields");
16-
test.equal(root.lookup("Test1.field3").comment, "Field with a comment.", "should parse triple-slash lines for message fields");
16+
test.equal(root.lookup("Test1.field3").comment, "Field with a comment and a <a href=\"http://example.com/foo/\">link</a>", "should parse triple-slash lines for message fields");
1717

1818
test.equal(root.lookup("Test3").comments.ONE, "Value with a comment.", "should parse blocks for enum values");
1919
test.equal(root.lookup("Test3").comments.TWO, null, "should not parse lines for enum values");

0 commit comments

Comments
 (0)