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

Allow escaping Scaladoc table cell delimiter #7247

Merged
merged 1 commit into from Sep 28, 2018

Conversation

Projects
None yet
3 participants
@janekdb
Member

janekdb commented Sep 21, 2018

Interpret \| as content instead of cell delimiter following the GitHub
Flavored Markdown Table Extension spec.

For example this markdown defines a 2 column table,

    | Purpose | Command |
    | ------- | ------- |
    | Count instances | cut -f2 data.tsv \| sort \| uniq -c |
    ┌──────────────────┬───────────────────────────────────┐
    │ Purpose          │ Command                           │
    ├──────────────────┼───────────────────────────────────┤
    │ Count instances  │ cut -f2 data.tsv | sort | uniq -c │
    └──────────────────┴───────────────────────────────────┘

Fixes scala/bug#11161

@scala-jenkins scala-jenkins added this to the 2.12.8 milestone Sep 21, 2018

@janekdb

This comment has been minimized.

Show comment
Hide comment
@janekdb

janekdb Sep 21, 2018

Member

Renders as expected,

image

This change also removes some of the complexity incurred by the earlier non-GHFM tables implementation.

Member

janekdb commented Sep 21, 2018

Renders as expected,

image

This change also removes some of the complexity incurred by the earlier non-GHFM tables implementation.

@janekdb janekdb requested a review from lrytz Sep 21, 2018

Allow escaping Scaladoc table cell delimiter
Interpret \| as content instead of cell delimiter following the GitHub
Flavored Markdown Table Extension spec.

For example this markdown defines a 2 column table,

    | Purpose | Command |
    | ------- | ------- |
    | Count instances | cut -f2 data.tsv \| sort \| uniq -c |

    ┌──────────────────┬───────────────────────────────────┐
    │ Purpose          │ Command                           │
    ├──────────────────┼───────────────────────────────────┤
    │ Count instances  │ cut -f2 data.tsv | sort | uniq -c │
    └──────────────────┴───────────────────────────────────┘

Fixes scala/bug#11161
@lrytz

lrytz approved these changes Sep 28, 2018

Given the limited (GHF)MD spec, this looks good to me.

Here's how Github renders a \ a \\ a \\\ a \\\\ b \| b \\| b \\\| b \\\\| c:

in table
a \ a \ a \\ a \\ b | b | b \| b \| c

outside table:

a \ a \ a \\ a \\ b | b \| b \| b \\| c

Not sure how to reverse-engineer this, but I think what you did for Scaladoc is the right thing. Here how it renders with this PR:

image

@lrytz lrytz merged commit 36a614b into scala:2.12.x Sep 28, 2018

3 checks passed

cla @janekdb signed the Scala CLA. Thanks!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
validate-main [1145] SUCCESS. Took 55 min.
Details
@janekdb

This comment has been minimized.

Show comment
Hide comment
@janekdb

janekdb Sep 28, 2018

Member

The image of the table shows the content as this implementation intends. And indeed, the wider issue of how GitHub FM interprets slash before other non-pipe characters is a feature creep matter for another day!

Member

janekdb commented Sep 28, 2018

The image of the table shows the content as this implementation intends. And indeed, the wider issue of how GitHub FM interprets slash before other non-pipe characters is a feature creep matter for another day!

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