Copilot commented on code in PR #2520: URL: https://github.com/apache/groovy/pull/2520#discussion_r3213165080
########## subprojects/groovy-groovysh/src/main/resources/nanorc/markdown.nanorc: ########## @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +syntax "Markdown" "\.(md|markdown)$" + +# Blockquotes +COMMENT: "^>.*$" + +# Lists: -, *, + (unordered); 1. 2. ... (ordered) +OPERATOR: "^[[:space:]]*[\*\+\-][[:space:]]" "^[[:space:]]*[0-9]+\.[[:space:]]" + +# Horizontal rules: --- *** ___ (with optional spaces) +SECTION: "^[[:space:]]*([\*\-_][[:space:]]?){3,}[[:space:]]*$" + +# Setext-style heading underlines (=== or --- on their own line) +SECTION: "^[=\-]+[[:space:]]*$" + +# ATX headings: # H1 through ###### H6 +TITLE: "^#{1,6}[[:space:]].*$" + +# Emphasis (italic): *text* or _text_ +VARIABLE: "(\*[^*]+\*)" "(_[^_]+_)" + +# Strong emphasis (bold): **text** or __text__ (overrides italic on overlap) +KEYWORD: "(\*\*[^*]+\*\*)" "(__[^_]+__)" + +# Strike-through: ~~text~~ +WARNING: "~~[^~]+~~" + +# Inline code: `code` +STRING: "`[^`]+`" + +# Links: [text](url) +LINK: "\[[^\]]+\]\([^)]+\)" +# Images:  +LINK: "!\[[^\]]*\]\([^)]+\)" +# Bare URLs +LINK: "\<https?://[^[:space:])>]+" Review Comment: In the Markdown highlighter, the bare-URL regex starts with `\<` but doesn’t close with `\>` (unlike the existing URL pattern in `nanorc/groovy.nanorc`). Adding the trailing word-boundary marker would keep the regex style consistent and avoid accidentally consuming trailing punctuation. ########## subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyCommands.groovy: ########## @@ -87,6 +87,7 @@ class GroovyCommands extends JlineCommandRegistry implements CommandRegistry { 'YAML' : 'groovy.yaml.YamlSlurper', 'XML' : 'groovy.xml.XmlParser', 'TOML' : 'groovy.toml.TomlSlurper', + 'MARKDOWN' : 'groovy.markdown.MarkdownSlurper', ] Review Comment: Adding MARKDOWN support to /slurp also needs an update to the /slurp `-f/--format` option tab-completion list (currently hardcoded in `slurpCompleter(...)` and missing MARKDOWN; it also omits existing formats like CSV/PROPERTIES). Otherwise users won’t discover the new format via completion even though it’s supported. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
