Switch to commonmark 0.5.0
Reasons to switch:
* Supports the CommonMark[1] "standard"
* Fewer dependencies
* BSD 2-clause license
* Fast (claims 10-20 times faster than pegdown)
* Cleaner extension API than Pegdown
* No timeout limit required
Testing with Documentation/markdown.md:
| cold vm | hot vm |
+---------+--------|
prior | 2.29s | 279ms |
this | 1.64s | 139ms |
Testing with Chromium's botmap.md:
| cold vm | hot vm |
+---------+--------|
prior | 3.47s | 946ms |
this | 1.83s | 257ms |
Changes in Markdown from Pegdown:
* No <<double angle>> quotes (confused with HTML).
* No table captions (no [caption after table]).
* Table columns are same width (no multi-column spans).
* Smart quotes can no longer be disabled by \'.
* Horizontal rule should be at least 3 -, e.g. ---.
(However GitHub Flavor -- is still accepted.)
[1] http://commonmark.org
Change-Id: Ief189d0226901a284d9b86d9798310786ae1e983
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/TocBlock.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/TocBlock.java
new file mode 100644
index 0000000..6a52720
--- /dev/null
+++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/TocBlock.java
@@ -0,0 +1,20 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gitiles.doc;
+
+import org.commonmark.node.CustomBlock;
+
+/** Block node {@code [TOC]} to display table of contents. */
+public class TocBlock extends CustomBlock {}