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

Words reflowed across a line break in objective text are missing a space between them #1409

Closed
byorgey opened this issue Aug 5, 2023 · 5 comments · Fixed by #1413
Closed
Labels
Bug The observed behaviour is incorrect or unexpected.

Comments

@byorgey
Copy link
Member

byorgey commented Aug 5, 2023

markdown2

Notice "nextto" and "samedirection" in the screenshot above. Notice that "to build" has a space even though those words are also on separate lines in the .yaml file. I think the difference may be that "next to" and "same direction" are contained in quoted (i.e. starting with a |) text in the .yaml file whereas "to build" is in unquoted text. For reference, here is the relevant .yaml file:

https://github.com/swarm-game/swarm/blob/1eb2f9c567b51a5242323bdf59277aff5879618a/data/scenarios/Tutorials/build.yaml

@byorgey byorgey added the Bug The observed behaviour is incorrect or unexpected. label Aug 5, 2023
@byorgey
Copy link
Member Author

byorgey commented Aug 5, 2023

I think this was introduced in #1106 .

@xsebek
Copy link
Member

xsebek commented Aug 5, 2023

@byorgey it was for sure, I was just lucky to not hit this during testing or did not notice. 😄

I am debugging it and will have a fix soon or revert.

@xsebek
Copy link
Member

xsebek commented Aug 5, 2023

Oh no, I did not realise the parser splits on every single token, so the created tree looks like this:

d =
    Document
        { paragraphs =
            [ Paragraph
                { nodes =
                    [ LeafText (fromList []) "A"
                    , LeafText (fromList []) " "
                    , LeafText (fromList []) "pedestal"

There are spaces in this structure where they should be, but this is definitely not what I expected when writing code that works with it.

@byorgey
Copy link
Member Author

byorgey commented Aug 5, 2023

the parser splits on every single token

Hah, that is an interesting choice. So if you just concatenate all the parsed nodes do you get back the exact original text?

@xsebek
Copy link
Member

xsebek commented Aug 6, 2023

@byorgey yes, now that I fixed chopping, you should get almost exactly the original text.

@mergify mergify bot closed this as completed in #1413 Aug 12, 2023
mergify bot pushed a commit that referenced this issue Aug 12, 2023
* use `Markdown.Document` as `entityDescription`
* add missing spaces in `chunksOf`
* fix code in `entities.yaml` (mostly types and few outdated snippets)
* add code markdown in craft tutorial
* use colours for types and entities

- closes #1408
- closes #1409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The observed behaviour is incorrect or unexpected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants