From 54f6e1be9b12635c8c3b1d3581ff5f51167d54d7 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Mon, 14 Mar 2022 12:43:59 -0700
Subject: [PATCH] Remove `native_divs` from allowed gfm extensions.

This allows `<div>` to be suppressed using `-raw_html`.
Previously `native_divs` was enabled but could
not be suppressed, because it was not in the list of
available extensions for commonmark-based formats.

Closes #7965.
---
 src/Text/Pandoc/Extensions.hs |  2 --
 test/command/7965.md          | 54 +++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 2 deletions(-)
 create mode 100644 test/command/7965.md

diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs
index 1cb77bd6d..449f56b96 100644
--- a/src/Text/Pandoc/Extensions.hs
+++ b/src/Text/Pandoc/Extensions.hs
@@ -265,7 +265,6 @@ githubMarkdownExtensions :: Extensions
 githubMarkdownExtensions = extensionsFromList
   [ Ext_pipe_tables
   , Ext_raw_html
-  , Ext_native_divs
   , Ext_auto_identifiers
   , Ext_gfm_auto_identifiers
   , Ext_autolink_bare_uris
@@ -356,7 +355,6 @@ getDefaultExtensions "plain"           = plainExtensions
 getDefaultExtensions "gfm"             = extensionsFromList
   [ Ext_pipe_tables
   , Ext_raw_html
-  , Ext_native_divs
   , Ext_auto_identifiers
   , Ext_gfm_auto_identifiers
   , Ext_autolink_bare_uris
diff --git a/test/command/7965.md b/test/command/7965.md
new file mode 100644
index 000000000..e470a8ca3
--- /dev/null
+++ b/test/command/7965.md
@@ -0,0 +1,54 @@
+```
+% pandoc -f markdown -t gfm
+Watson and Crick (1953)
+
+<div id="refs" class="references csl-bib-body hanging-indent">
+
+<div id="ref-WatsonCrick1953" class="csl-entry">
+
+Watson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic
+Acids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):
+737–38. <https://doi.org/10.1038/171737a0>.
+
+</div>
+
+</div>
+^D
+Watson and Crick (1953)
+
+<div id="refs" class="references csl-bib-body hanging-indent">
+
+<div id="ref-WatsonCrick1953" class="csl-entry">
+
+Watson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic
+Acids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):
+737–38. <https://doi.org/10.1038/171737a0>.
+
+</div>
+
+</div>
+```
+
+```
+% pandoc -f markdown -t gfm-raw_html
+Watson and Crick (1953)
+
+<div id="refs" class="references csl-bib-body hanging-indent">
+
+<div id="ref-WatsonCrick1953" class="csl-entry">
+
+Watson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic
+Acids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):
+737–38. <https://doi.org/10.1038/171737a0>.
+
+</div>
+
+</div>
+^D
+Watson and Crick (1953)
+
+Watson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic
+Acids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):
+737–38. <https://doi.org/10.1038/171737a0>.
+```
+