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

fix: respect empty lines in example block #128

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

Conversation

Barbapapazes
Copy link
Member

@Barbapapazes Barbapapazes commented Feb 25, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR allow blank lines within example block.

related to unjs/h3#673 and to unjs/h3#672 where the extra line was always removed.

Previously, blank lines was automatically removed unless you use triple ` (backticks) to define the block. Now, you can write

// some code

// some code

and it will be rendered as

// some code

// some code

Before it was rendered as

// some code
// some code

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Barbapapazes Barbapapazes added the bug Something isn't working label Feb 25, 2024
@Barbapapazes Barbapapazes self-assigned this Feb 25, 2024
Copy link

cloudflare-workers-and-pages bot commented Feb 25, 2024

Deploying untyped with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: be5d453
Status:Β βœ…Β  Deploy successful!
Preview URL: https://bcb50a40.untyped.pages.dev
Branch Preview URL: https://fix-respect-example-multilin.untyped.pages.dev

View logs

@Barbapapazes Barbapapazes requested a review from pi0 February 25, 2024 17:23
Copy link

codecov bot commented Feb 25, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 57.88%. Comparing base (71cb7e3) to head (d2442b4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
- Coverage   57.90%   57.88%   -0.03%     
==========================================
  Files          18       18              
  Lines        1872     1871       -1     
  Branches      284      284              
==========================================
- Hits         1084     1083       -1     
  Misses        779      779              
  Partials        9        9              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@Barbapapazes Barbapapazes changed the title fix: respect multines example block fix: respect empty lines in example block Feb 25, 2024
src/loader/babel.ts Outdated Show resolved Hide resolved
src/loader/babel.ts Outdated Show resolved Hide resolved
title: "",
tsType: "'src' | 'root'",
description: "",
tags: ["@note This is a note.", "```js\nexport default secret\n```"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't inline code go into the description?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. I don't know. What do you think? πŸ€·β€β™‚οΈ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But because there is the @, the title and description are the content above

see https://github.com/unjs/untyped/blob/main/src/loader/babel.ts#L253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants