From 1d986e2d6a8c5ccaef819a029ebb0e0bd1ffbe32 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Sun, 1 Jan 2023 17:06:58 -0500 Subject: [PATCH 1/5] Add `shortcodes` by default --- Cargo.lock | 141 ++++++++++++++++++++------------ README.md | 1 + ext/commonmarker/Cargo.toml | 3 +- ext/commonmarker/src/options.rs | 4 + lib/commonmarker/config.rb | 1 + lib/commonmarker/version.rb | 2 +- test/test_extensions.rb | 16 +++- test/test_maliciousness.rb | 4 + 8 files changed, 112 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f61ee5fe..62d3e7ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,9 +89,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "cexpr" @@ -121,9 +121,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.29" +version = "4.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" dependencies = [ "bitflags", "clap_derive", @@ -168,10 +168,10 @@ dependencies = [ [[package]] name = "comrak" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11e55664fcff7f4d37cc2adf3a1996913692f037312f4ab0909047fdd2bf962" +source = "git+https://github.com/kivikakk/comrak#7be2585180087bdb188b829e73e1617c5670505d" dependencies = [ "clap", + "emojis", "entities", "memchr", "once_cell", @@ -243,6 +243,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "emojis" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fe60b864b6544ad211d4053ced474a9b9d2c8d66b77f01d6c6bcfed10c6bf0" +dependencies = [ + "phf", +] + [[package]] name = "entities" version = "1.0.1" @@ -366,9 +375,9 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi", "io-lifetimes", @@ -378,9 +387,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "lazy_static" @@ -396,9 +405,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libloading" @@ -427,9 +436,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "magnus" @@ -476,9 +485,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" dependencies = [ "memchr", "minimal-lexical", @@ -486,9 +495,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "onig" @@ -526,9 +535,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pest" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f400b0f7905bf702f9f3dc3df5a121b16c54e9e8012c082905fdf09a931861a" +checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4" dependencies = [ "thiserror", "ucd-trie", @@ -536,9 +545,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "423c2ba011d6e27b02b482a3707c773d19aec65cc024637aec44e19652e66f63" +checksum = "96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603" dependencies = [ "pest", "pest_generator", @@ -546,9 +555,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e64e6c2c85031c02fdbd9e5c72845445ca0a724d419aa0bc068ac620c9935c1" +checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7" dependencies = [ "pest", "pest_meta", @@ -559,15 +568,33 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57959b91f0a133f89a68be874a5c88ed689c19cd729ecdb5d762ebf16c64d662" +checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065" dependencies = [ "once_cell", "pest", "sha1", ] +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + [[package]] name = "pkg-config" version = "0.3.26" @@ -614,36 +641,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] [[package]] name = "rb-sys" -version = "0.9.44" +version = "0.9.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f48777b8161ff5c077ad74ce486ebe963ca8a92257512bab473b405a80d69f" +checksum = "aa291f69bcc44f8e96597a3f39e9933fde6977b825415cfaa670ac49b8ab7c99" dependencies = [ "rb-sys-build", ] [[package]] name = "rb-sys-build" -version = "0.9.44" +version = "0.9.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a46785122aff7077527b78c2518d739c45dc0fbc410a2b8361076ff4bbf993f9" +checksum = "d998fd6ef588471d6d7cca24c4da88eda5e6757b6885c55760e856ecdb254c3d" dependencies = [ "bindgen", "regex", @@ -701,9 +728,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.36.4" +version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ "bitflags", "errno", @@ -715,9 +742,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safemem" @@ -736,15 +763,15 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.148" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -753,9 +780,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -785,6 +812,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + [[package]] name = "strsim" version = "0.10.0" @@ -793,9 +826,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -847,18 +880,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -900,9 +933,9 @@ checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -912,9 +945,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode_categories" diff --git a/README.md b/README.md index 1ad27525..a485f1e8 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ Commonmarker.to_html('"Hi *there*"', options: { | `footnotes` | Enables the footnotes extension per `cmark-gfm`. | `false` | | `description_lists` | Enables the description lists extension.. | `false` | | `front_matter_delimiter` | Enables the front matter extension. | `""` | +| `shortcodes` | Enables the shortcodes extension. | `true` | For more information on these options, see [the comrak documentation](https://github.com/kivikakk/comrak#usage). diff --git a/ext/commonmarker/Cargo.toml b/ext/commonmarker/Cargo.toml index 081b0a91..82bd4d8c 100644 --- a/ext/commonmarker/Cargo.toml +++ b/ext/commonmarker/Cargo.toml @@ -5,7 +5,8 @@ edition = "2021" [dependencies] magnus = "0.4" -comrak = "0.15" +# ref until `shortcodes` is released +comrak = { git = "https://github.com/kivikakk/comrak", ref = "7be2585180087bdb188b829e73e1617c5670505d", features = ["shortcodes"] } [lib] name = "commonmarker" diff --git a/ext/commonmarker/src/options.rs b/ext/commonmarker/src/options.rs index 86fde804..a5304dbd 100644 --- a/ext/commonmarker/src/options.rs +++ b/ext/commonmarker/src/options.rs @@ -68,6 +68,7 @@ const EXTENSION_HEADER_IDS: &str = "header_ids"; const EXTENSION_FOOTNOTES: &str = "footnotes"; const EXTENSION_DESCRIPTION_LISTS: &str = "description_lists"; const EXTENSION_FRONT_MATTER_DELIMITER: &str = "front_matter_delimiter"; +const EXTENSION_SHORTCODES: &str = "shortcodes"; fn iterate_extension_options(comrak_options: &mut ComrakOptions, options_hash: RHash) { options_hash @@ -103,6 +104,9 @@ fn iterate_extension_options(comrak_options: &mut ComrakOptions, options_hash: R Ok(Cow::Borrowed(EXTENSION_FRONT_MATTER_DELIMITER)) => { comrak_options.extension.front_matter_delimiter = try_convert_string(value); } + Ok(Cow::Borrowed(EXTENSION_SHORTCODES)) => { + comrak_options.extension.shortcodes = value.try_convert::()?; + } _ => {} } Ok(ForEach::Continue) diff --git a/lib/commonmarker/config.rb b/lib/commonmarker/config.rb index 3183d104..9fd8f497 100644 --- a/lib/commonmarker/config.rb +++ b/lib/commonmarker/config.rb @@ -27,6 +27,7 @@ module Config footnotes: false, description_lists: false, front_matter_delimiter: nil, + shortcodes: true, }, format: [:html].freeze, }.freeze diff --git a/lib/commonmarker/version.rb b/lib/commonmarker/version.rb index 8f9172c3..9284bfe6 100644 --- a/lib/commonmarker/version.rb +++ b/lib/commonmarker/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Commonmarker - VERSION = "1.0.0.pre4" + VERSION = "1.0.0.pre5" end diff --git a/test/test_extensions.rb b/test/test_extensions.rb index 5ad2265e..9a2cf2b6 100644 --- a/test/test_extensions.rb +++ b/test/test_extensions.rb @@ -28,14 +28,22 @@ def test_uses_specified_extensions end end - def test_bad_extension_specifications - assert_raises(TypeError) { Commonmarker.to_html(@markdown, options: "nope") } - end - def test_comments_are_kept_as_expected options = { render: { unsafe_: true }, extension: { tagfilter: true } } assert_equal(" <xmp>\n", Commonmarker.to_html(" \n", options: options)) end + + def test_emoji_renders_by_default + assert_equal("<p>Happy Friday! 😄</p>\n", + Commonmarker.to_html("Happy Friday! :smile:")) + end + + def test_can_disable_emoji_renders + options = { extension: { shortcodes: false } } + + assert_equal("<p>Happy Friday! :smile:</p>\n", + Commonmarker.to_html("Happy Friday! :smile:", options: options)) + end end diff --git a/test/test_maliciousness.rb b/test/test_maliciousness.rb index 7d30eaf8..87a7ef4c 100644 --- a/test/test_maliciousness.rb +++ b/test/test_maliciousness.rb @@ -49,6 +49,10 @@ def test_bad_options_value assert_equal("parse option `:smart` must be Boolean; got Integer", err.message) end + def test_bad_extension_type + assert_raises(TypeError) { Commonmarker.to_html(@markdown, options: { extensions: "nope" }) } + end + def test_non_utf8 err = assert_raises(TypeError) do Commonmarker.to_html("foo \n baz".encode("US-ASCII")) From bb7b2d8efae129815b11c66dcd57a6e3d3b2c123 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" <gjtorikian@users.noreply.github.com> Date: Sun, 8 Jan 2023 18:11:51 -0500 Subject: [PATCH 2/5] rubocop: appease --- test/test_extensions.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test_extensions.rb b/test/test_extensions.rb index 6bd9e6ce..637d52ec 100644 --- a/test/test_extensions.rb +++ b/test/test_extensions.rb @@ -38,14 +38,18 @@ def test_comments_are_kept_as_expected end def test_emoji_renders_by_default - assert_equal("<p>Happy Friday! 😄</p>\n", - Commonmarker.to_html("Happy Friday! :smile:")) + assert_equal( + "<p>Happy Friday! 😄</p>\n", + Commonmarker.to_html("Happy Friday! :smile:"), + ) end def test_can_disable_emoji_renders options = { extension: { shortcodes: false } } - assert_equal("<p>Happy Friday! :smile:</p>\n", - Commonmarker.to_html("Happy Friday! :smile:", options: options)) + assert_equal( + "<p>Happy Friday! :smile:</p>\n", + Commonmarker.to_html("Happy Friday! :smile:", options: options), + ) end end From 65e73525d356868c932524df440b973e5e9f1f96 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" <gjtorikian@users.noreply.github.com> Date: Wed, 25 Jan 2023 17:14:19 -0800 Subject: [PATCH 3/5] point to comrak 0.16 --- Cargo.lock | 21 +++++++++++++++++++-- ext/commonmarker/Cargo.toml | 3 +-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81944253..c5580aab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -167,8 +167,9 @@ dependencies = [ [[package]] name = "comrak" -version = "0.15.0" -source = "git+https://github.com/kivikakk/comrak#7be2585180087bdb188b829e73e1617c5670505d" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784836d0812dade01579cc0cc9b1684847044e716fd7aa6bffbc172e42199500" dependencies = [ "clap", "emojis", @@ -179,6 +180,7 @@ dependencies = [ "pest_derive", "regex", "shell-words", + "slug", "syntect", "typed-arena", "unicode_categories", @@ -213,6 +215,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "deunicode" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" + [[package]] name = "digest" version = "0.10.6" @@ -818,6 +826,15 @@ version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +[[package]] +name = "slug" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" +dependencies = [ + "deunicode", +] + [[package]] name = "strsim" version = "0.10.0" diff --git a/ext/commonmarker/Cargo.toml b/ext/commonmarker/Cargo.toml index 82bd4d8c..e8626fdd 100644 --- a/ext/commonmarker/Cargo.toml +++ b/ext/commonmarker/Cargo.toml @@ -5,8 +5,7 @@ edition = "2021" [dependencies] magnus = "0.4" -# ref until `shortcodes` is released -comrak = { git = "https://github.com/kivikakk/comrak", ref = "7be2585180087bdb188b829e73e1617c5670505d", features = ["shortcodes"] } +comrak = { version = "^0.16", features = ["shortcodes"] } [lib] name = "commonmarker" From 557d005e025a47dd4c5a3beda6785410a82ee62c Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" <gjtorikian@users.noreply.github.com> Date: Wed, 25 Jan 2023 17:19:08 -0800 Subject: [PATCH 4/5] :gem: bump to 1.0.0.pre7 --- lib/commonmarker/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commonmarker/version.rb b/lib/commonmarker/version.rb index 9284bfe6..cffc3ea3 100644 --- a/lib/commonmarker/version.rb +++ b/lib/commonmarker/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Commonmarker - VERSION = "1.0.0.pre5" + VERSION = "1.0.0.pre7" end From 1e852f9dc5abd7bd7d57164af08a72f105c90500 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" <gjtorikian@users.noreply.github.com> Date: Wed, 25 Jan 2023 18:13:38 -0800 Subject: [PATCH 5/5] Tweak theme list --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 907b7e9f..cb214556 100644 --- a/README.md +++ b/README.md @@ -131,15 +131,17 @@ Commonmarker.to_html(code, plugins: { syntax_highlighter: nil }) Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: nil } }) ``` -Available themes ([source](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations)): - -- base16-ocean.dark -- base16-eighties.dark -- base16-mocha.dark -- base16-ocean.light -- InspiredGitHub -- Solarized (dark) -- Solarized (light) +##### Available themes + +Here's [a list of available themes](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations): + +- `"base16-ocean.dark"` +- `"base16-eighties.dark"` +- `"base16-mocha.dark"` +- `"base16-ocean.light"` +- `"InspiredGitHub"` +- `"Solarized (dark)"` +- `"Solarized (light)"` ## Output formats