Use a smaller set of github extensions for markdown (#2002)
* Use a smaller set of github extensions for markdown
* Explicit add of the github extensions for markdown
diff --git a/lib/src/markdown_processor.dart b/lib/src/markdown_processor.dart
index 90a4a80..368fd31 100644
--- a/lib/src/markdown_processor.dart
+++ b/lib/src/markdown_processor.dart
@@ -141,11 +141,19 @@
final List<md.InlineSyntax> _markdown_syntaxes = [
new _InlineCodeSyntax(),
- new _AutolinkWithoutScheme()
-]..addAll(md.ExtensionSet.gitHubWeb.inlineSyntaxes);
+ new _AutolinkWithoutScheme(),
+ md.InlineHtmlSyntax(),
+ md.StrikethroughSyntax(),
+ md.AutolinkExtensionSyntax(),
+];
-final List<md.BlockSyntax> _markdown_block_syntaxes = []
- ..addAll(md.ExtensionSet.gitHubWeb.blockSyntaxes);
+final List<md.BlockSyntax> _markdown_block_syntaxes = [
+ const md.FencedCodeBlockSyntax(),
+ const md.HeaderWithIdSyntax(),
+ const md.SetextHeaderWithIdSyntax(),
+ const md.TableSyntax(),
+
+];
// Remove these schemas from the display text for hyperlinks.
final RegExp _hide_schemes = new RegExp('^(http|https)://');
diff --git a/test/model_test.dart b/test/model_test.dart
index 9fcfb68..c5c733b 100644
--- a/test/model_test.dart
+++ b/test/model_test.dart
@@ -1340,6 +1340,16 @@
'<tbody><tr><td><a href="fake/DocumentWithATable/foo-constant.html">foo</a></td>'),
isTrue);
});
+
+ test('Verify there is no emoji support', () {
+ TopLevelVariable tpvar = fakeLibrary.constants.firstWhere((t) => t.name == 'hasMarkdownInDoc');
+ docsAsHtml = tpvar.documentationAsHtml;
+ expect(
+ docsAsHtml.contains(
+ '3ffe:2a00:100:7031::1'),
+ isTrue);
+ });
+
});
group('doc references', () {
diff --git a/testing/test_package/lib/fake.dart b/testing/test_package/lib/fake.dart
index 248f7d9..5797624 100644
--- a/testing/test_package/lib/fake.dart
+++ b/testing/test_package/lib/fake.dart
@@ -70,6 +70,9 @@
// ignore: uri_does_not_exist
export 'package:test_package/fake.dart';
+/// Does not render with emoji 3ffe:2a00:100:7031::1
+const int hasMarkdownInDoc = 1;
+
abstract class ImplementingThingy implements BaseThingy {}
abstract class BaseThingy {