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

Hard breaks aren't reflected in output #697

Closed
2 tasks done
Kyle-Ye opened this issue Jun 18, 2023 · 1 comment · Fixed by #714
Closed
2 tasks done

Hard breaks aren't reflected in output #697

Kyle-Ye opened this issue Jun 18, 2023 · 1 comment · Fixed by #714
Labels
bug Something isn't working

Comments

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Jun 18, 2023

Description

See full issue here swiftlang/swift-docc#477

After swiftlang/swift-docc#633, swift-docc will emit LineBreak from swift-markdown into "\n". But swift-docc-render still does not treat the new line correctly.

SCR-20230618-qoil

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

{
  "inlineContent": [
    {
      "text": "This text should",
      "type": "text"
    },
    {
      "text": "\n",
      "type": "text"
    },
    {
      "text": "appear on two lines.",
      "type": "text"
    }
  ],
  "type": "paragraph"
}

Render text in 2 lines

Actual behavior

Render text in 1 line

Steps To Reproduce

  1. Use the following markdown input
let source = #"""
This text should\
appear on two lines.

This text should  
appear on two lines.

This is the second paragraph.
"""#
  1. Use this version of docc Make visitLineBreak return new line instead of space swift-docc#633
  2. Set VUE_APP_DEV_SERVER_PROXY to the corresponding .docc-build folder

Swift-DocC-Render Version Information

No response

@mportiz08
Copy link
Contributor

mportiz08 commented Jul 7, 2023

I can help look into this. I'm thinking we would probably just want to map the inline text nodes with newline characters into <br> HTML elements.

I'll need to play with the DocC PR to see if we can rely on the newline always being in its own individual text node or if it could possibly be interspersed with other text.

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 a pull request may close this issue.

2 participants