Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression with indented special characters in shell blocks #428

Open
thpani opened this issue May 23, 2023 · 2 comments
Open

Regression with indented special characters in shell blocks #428

thpani opened this issue May 23, 2023 · 2 comments

Comments

@thpani
Copy link

thpani commented May 23, 2023

The treatment of special characters in shell blocks ($, >) changed in #397, s.t. these characters now have special meaning, even if indented.

Unfortunately, this results in a regression against v2.1.0.
Consider the following program and test that contains an indented >:

test.md

```sh
$ ./test.sh
A
...
 > D
...
E
...
H
```

test.sh

#!/bin/bash

cat <<EOF
A
 > B
 > C
 > D
E
F
G
H
EOF

In mdx 2.1.0 ocaml-mdx test test.md used to succeed, but now results in a .corrected file, because the > D receives special meaning.

@Leonidas-from-XIV
Copy link
Collaborator

Leonidas-from-XIV commented May 23, 2023

Hi @thpani. I tested it and what I get out is this:

```sh
$ ./test.sh
A
 > B
 > C
 > D
E
F
G
H
```

The differences being

@@ -1,10 +1,11 @@
 ```sh
 $ ./test.sh
 A
-...
+ > B
+ > C
  > D
-...
 E
-...
+F
+G
 H
```

So it basically decides that the input and the output don't match but generates essentially the same file (modulo the ellipsis, which the .corrected files can never have). This seems to be a bug in the comparison function between input and expected output.

@thpani
Copy link
Author

thpani commented May 23, 2023

Hi @Leonidas-from-XIV!

Yes, that's the output I get on mdx-2.3.0.
My point is that in mdx-2.1.0, the ellipses consumed the entire output, i.e., the output was consistent with the expectation (no .corrected file is generated).

thpani added a commit to apalache-mc/apalache that referenced this issue May 24, 2023
Update the nix flake lock file.

This fixes the outdated glibc version, as described here:
#2565 (comment)

I updated to a fixed revision from Jan 2023, to pull in an old version of ocaml-mdx.
This is a workaround for the following regressions in later versions of mdx:
realworldocaml/mdx#428

To update nix flake inputs to a specific revision, I ran:

    nix flake update --override-input nixpkgs github:NixOS/nixpkgs/<rev>
thpani added a commit to apalache-mc/apalache that referenced this issue May 24, 2023
Update the nix flake lock file.

This fixes the outdated glibc version, as described here:
#2565 (comment)

I updated to a fixed revision from Jan 2023, to pull in an old version of ocaml-mdx.
This is a workaround for the following regressions in later versions of mdx:
realworldocaml/mdx#428

To update nix flake inputs to a specific revision, I ran:

    nix flake update --override-input nixpkgs github:NixOS/nixpkgs/<rev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants