Let's for once do something useful.
Given the text from a Try It Online codegolf submission, produce the equivalent Chat Mini Challenge submission, which is of the form
Language, N bytes: [`code`](URL)
or (if submission is a single byte – TIO will add a trailing s on the first line only if needed)
Language, 1 byte: [`code`](URL)
You may assume that the submission
- has only one line
- does not contain backticks (
`
) - has no leading whitespace
- has a regular format like in the examples below; the code line is indented with four spaces (
<pre><code>
…</code></pre>
), i.e. no trailing whitespace.
Note that the submission may have a syntax highlighting tag. See last example.
You may optionally include the title text, i.e. …url "Language - Try It Online"
.
Examples
Given
# [05AB1E], 1 byte
Ô
[Try it online!][TIO-j3v72bss]
[05AB1E]: https://github.com/Adriandmen/05AB1E
[TIO-j3v72bss]: https://tio.run/##MzBNTDJM/f//8JT//zNSgSAnJycfDAA "05AB1E – Try It Online"
return
05AB1E, 1 byte: [`Ô`](https://tio.run/##MzBNTDJM/f//8JT//zNSgSAnJycfDAA)
or
05AB1E, 1 byte: [`Ô`](https://tio.run/##MzBNTDJM/f//8JT//zNSgSAnJycfDAA "05AB1E – Try It Online")
Given
# [Brachylog], 4 bytes
ḅhᵐc
[Try it online!][TIO-j3v75978]
[Brachylog]: https://github.com/JCumin/Brachylog
[TIO-j3v75978]: https://tio.run/##SypKTM6ozMlPN/r//@GO1oyHWyck//@vlJGampOTDwZK/6MA "Brachylog – Try It Online"
return
Brachylog, 4 bytes: [`ḅhᵐc`](https://tio.run/##SypKTM6ozMlPN/r//@GO1oyHWyck//@vlJGampOTDwZK/6MA)
Given
# [APL (Dyalog Unicode)], 15 bytes
<!-- language-all: lang-apl -->
⍴⍨¨⍳
[Try it online!][TIO-j44jgrps]
[APL (Dyalog Unicode)]: https://www.dyalog.com/
[TIO-j44jgrps]: https://tio.run/##AScA2P9hcGwtZHlhbG9n//9m4oaQ4o204o2owqjijbP//zcxNjDijLZmIDQ "APL (Dyalog Unicode) – Try It Online"
return
APL (Dyalog Unicode), 15 bytes: [`⍴⍨¨⍳`](https://tio.run/##AScA2P9hcGwtZHlhbG9n//9m4oaQ4o204o2owqjijbP//zcxNjDijLZmIDQ)
]
? \$\endgroup\$]
though. \$\endgroup\$