charmbracelet / glow

Render markdown on the CLI, with pizzazz! 💅🏻
MIT License
16k stars 349 forks source link

Inconsistent spacing #630

Open ic-768 opened 2 months ago

ic-768 commented 2 months ago

I am rendering some markdown, but the spacing between segments seems to be inconsistent. Here's my code:

# Instructions

- **BUILD**
  - To build the app, navigate to `/backend` and run `npm run build`.
  - This should take care of  \***everything**\*  : installing dependencies, building the frontend and backend, and setting files up so that the backend and the electron app can both serve the frontend.

- **RUNNING THE APP IN THE BROWSER**
  - To run the app, use `npm run dev` from within `backend`.
    - The app will run on port `3000` by default.
    - The port and other default settings can be changed by editing `backend/config.ts`.

- **RUNNING THE ELECTRON APP**
  - Run `npm start` from within `electron`.
  - To edit default settings, you can edit the `settings.json` file in the app's default directory:
    - Linux - Either `$XDG_CONFIG_HOME/ocpi-candy` or `~/.config/ocpi-candy`
    - Windows - `%APPDATA%/ocpi-candy`
    - macOS - `~/Library/Application\ Support/ocpi-candy`

> **Note:** Because the web app lets users configure the settings directly in code, whereas the electron app exposes a JSON file in the app directory, the two `backend` directories have diverged and must be maintained separately.

and here's the actual rendered output:

image

as you can see, the BUILD section is stuck to RUNNING THE APP IN THE BROWSER, and the note at the bottom seems to have extraneous spacing over it

MaximilianSoerenPollak commented 2 months ago

You can just put '
' as a break/newline if you want to. That way you have a more precicse way to specify breaks.


- **BUILD**
  - To build the app, navigate to `/backend` and run `npm run build`.
  - This should take care of  \***everything**\*  : installing dependencies, building the frontend and backend, and setting files up so that the backend and the electron app can both serve the frontend.  

<br>

- **RUNNING THE APP IN THE BROWSER**
    - To run the app, use `npm run dev` from within `backend`.
        - The app will run on port `3000` by default.
        - The port and other default settings can be changed by editing `backend/config.ts`.  

<br>

- **RUNNING THE ELECTRON APP**
    - Run `npm start` from within `electron`.
    - To edit default settings, you can edit the `settings.json` file in the app's default directory:
        - Linux - Either `$XDG_CONFIG_HOME/ocpi-candy` or `~/.config/ocpi-candy`
        - Windows - `%APPDATA%/ocpi-candy`
        - macOS - `~/Library/Application\ Support/ocpi-candy`

> **Note:** Because the web app lets users configure the settings directly in code, whereas the electron app exposes a JSON file in the app directory, the two `backend` directories have diverged and must be maintained separately.

Then the output would look like this.

image