unison icon indicating copy to clipboard operation
unison copied to clipboard

Docs: Roundtrip issue with inlined code

Open rlmark opened this issue 3 years ago • 1 comments

A doc containing inlined code examples will sometimes be expanded into an invalid transcluded snippet.

Mini example (also in attached transcript):

doc = {{ `` 1 + 2 + 3`` inline }}

turns into:

doc : Doc
doc = {{ {{ docExample 1 (_ + -> 1 + 2 + 3) }} }}

Simple inline snippets like ``1+2`` or literals like ``"Hi"`` are fine, and more complicated inline snippets are also okay, like ``List.map (n -> n + 1) [1,2]``.

docExampleIssue.md

rlmark avatar Feb 04 '22 04:02 rlmark

This is actually unrelated to #4660 it's caused by quirks with the `` syntax, which is special-cased to interpret ``foo x y`` as docExample 2 do x y -> foo x y, that is, to automatically interpret x and y as free variables.

Probably some special handling of operator chains would be good.

pchiusano avatar Oct 28 '25 23:10 pchiusano