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

style: Don't convert single \n to <br> #3414

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

leonardehrenfried
Copy link

@leonardehrenfried leonardehrenfried commented Aug 28, 2023

As described in #3155 we (OpenTripPlanner) tend to have quite long, multi-paragraph descriptions of our fields.

In Markdown a single \n is ignored and only two \n should lead to a new paragraph being started.

markdown-it makes this fairly easy to achieve, which is why this PR is tiny.

Before

Screenshot from 2023-08-28 12-59-50

After

Screenshot from 2023-08-28 13-00-02

I've also taken the liberty to update the dev instructions.

Many thanks for this wonderful tool!

@changeset-bot
Copy link

changeset-bot bot commented Aug 28, 2023

🦋 Changeset detected

Latest commit: a6e9612

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
graphiql Minor
@graphiql/react Minor
@graphiql/plugin-code-exporter Major
@graphiql/plugin-explorer Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 28, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@leonardehrenfried leonardehrenfried changed the title Don't convert single \n to <br> style: Don't convert single \n to <br> Aug 28, 2023
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.84%. Comparing base (2348641) to head (ce09e53).
Report is 79 commits behind head on main.

❗ Current head ce09e53 differs from pull request most recent head a6e9612. Consider uploading reports for the commit a6e9612 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3414      +/-   ##
==========================================
+ Coverage   55.75%   55.84%   +0.09%     
==========================================
  Files         110      110              
  Lines        5243     5257      +14     
  Branches     1426     1433       +7     
==========================================
+ Hits         2923     2936      +13     
  Misses       1897     1897              
- Partials      423      424       +1     
Files Coverage Δ
packages/graphiql-react/src/markdown.ts 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@acao
Copy link
Member

acao commented Sep 26, 2023

@leonardehrenfried thank you for this, this is exactly how it should behave, I agree. I recall there was disagreement some years back and again with the redesign about this, I will look up some issues/discussions/? when I have more time. @thomasheyenbrock or @jonathanawesome what do you think?

one last thing, can you add a changeset as per the changset bot comment? then it'll be ready to go!

(we used to use conventional commits with lerna but contributors had issues, switched to changesets but I miss conventional commits often. i'm looking into ways to perhaps combine them, so many ways to go about it!)

@leonardehrenfried
Copy link
Author

@acao I've added a changeset. I hope I'm bumping the right packages.

@acao
Copy link
Member

acao commented Sep 27, 2023

awesome, thanks @leonardehrenfried ! I think we would make this a minor release for @graphiql/react as well

@leonardehrenfried
Copy link
Author

Changeset was updated.

@leonardehrenfried
Copy link
Author

Could I perhaps have another review for this?

@acao
Copy link
Member

acao commented Nov 20, 2023

hey thanks for this! i'll come back to this later today or tomorrow and release it with some other new features for this @graphiql/react minor release

@leonardehrenfried
Copy link
Author

Lovely thanks!

@leonardehrenfried
Copy link
Author

Could I perhaps have another review for this, please?

@leonardehrenfried
Copy link
Author

@acao Isn't this good to merge?

@acao
Copy link
Member

acao commented Apr 18, 2024

sorry I hope to have more time for this in the coming months. my current commitments are for my day job and for a grant to work on the GraphQL LSP server that I'm wrapping up

@leonardehrenfried
Copy link
Author

I totally understand. Thanks for maintaining GraphiQL!

@acao
Copy link
Member

acao commented Apr 19, 2024

i think the only thing still stumping me is whether this constitutes a breaking change for some use cases, and whether there is some kind of markdown it config that solves the issue this intended to solve? maybe it was a workaround for the previous markdown library, was it marked? I need to look at the original history from, say, tag 0.7.y era or earlier to determine what the original purpose was

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants