Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Spacing around markdown links #45

Closed
nate-double-u opened this issue Oct 22, 2020 · 11 comments · Fixed by #93
Closed

Spacing around markdown links #45

nate-double-u opened this issue Oct 22, 2020 · 11 comments · Fixed by #93
Labels
bug Something isn't working

Comments

@nate-double-u
Copy link
Member

It looks like there is space being added around links, causing some punctuation to be incorrectly spaced. You can see this issue on the Dex IdP website, which is generated from this template.

If you run the site locally, you can see this on the pod-overview page where the following code:

## Pod Templates

Pod templates are pod specifications which are included in other objects, such as
[Replication Controllers](/docs/concepts/workloads/controllers/replicationcontroller/), [Jobs](/docs/concepts/jobs/run-to-completion-finite-workloads/), and
[DaemonSets](/docs/concepts/workloads/controllers/daemonset/).  Controllers use Pod Templates to make actual pods.
The sample below is a simple manifest for a Pod which contains a container that prints
a message.

generates this output:
Screen Shot 2020-10-22 at 4 50 43 PM

@nate-double-u nate-double-u added the bug Something isn't working label Oct 22, 2020
@GauravSarkar
Copy link
Contributor

@nate-double-u I have gone through the issue and I have certain doubts.
1)There is no pod-overview file under test-content, then how the above link is working
2)Is it spacing around the links in the Dex Idp website creation files or there is some issue in the template itself.
Little bit clarification can help me understand the problem better

@nate-double-u
Copy link
Member Author

Hi @GauravSarkar, thanks for looking into this!

1)There is no pod-overview file under test-content, then how the above link is working

Because it's test content, you can only see it when you run the site locally: http://localhost:1313/test-content/pod-overview/#pod-templates

2)Is it spacing around the links in the Dex Idp website creation files or there is some issue in the template itself.

I believe that the issue is with the template itself. When you run the site locally you can see the extra spaces. I linked to the Dex IdP site as an example because it's generated from this template, and hasn't had many changes made to the styling. Any fix made here will likely be copied downstream.

You can also replicate this bug by copying the code snippet above into the home page and running it locally.

@nate-double-u
Copy link
Member Author

Just a note @GauravSarkar, I've removed the pod-templates page entirely now in favour of a smoke test page (https://cncf-hugo-starter.netlify.app/docs/test/).

I think that for testing this, we'll need to recreate the issue locally.

@GauravSarkar
Copy link
Contributor

@nate-double-u I am still looking into the matter. I have not been able to find the solution for it. Thanks for the update.

@GauravSarkar
Copy link
Contributor

@nate-double-u I wanted to understand this project completely. So I was studying the code base. If you can suggest like how should I continue so that I can properly understand what is going on in the overall project.

@nate-double-u
Copy link
Member Author

Hi @GauravSarkar -- you bring up a good point, I should open a ticket to more clearly explain what this project's goals are.

With this project, we are trying to build a template that can be used, quickly and easily, by any CNCF Sandbox Project that needs one.

@nate-double-u
Copy link
Member Author

nate-double-u commented Jul 23, 2021

This spacing issue can be seen live on the smoke test page in the images section.

Screen Shot 2021-07-22 at 8 58 39 PM

(Note: PR #73 is moving the smoke test page to demo. https://deploy-preview-73--cncf-hugo-starter.netlify.app/docs/demo/)

@kapunahelewong
Copy link
Contributor

It seems like it's happening in the generated html (see extra space when inspecting), even though it's not in the markdown, which leads me to suspect the markdown parser.
Screen Shot 2021-07-23 at 11 13 13 AM

It looks like this is happening in Goldmark, but not in the previous default of BlackFriday:
https://discourse.gohugo.io/t/white-space-issue-in-markdown/25258/2 and
yuin/goldmark#126

And there might be something in here but I haven't found it yet:
https://gohugo.io/getting-started/configuration-markup/

Anyway, adding clues that might help us track it down.

@chalin
Copy link
Collaborator

chalin commented Jul 23, 2021

We've faced this problem on other websites. It arises because of the extra spaces and the "wrong" kind of comments in the link render hook file: layouts/_default/_markup/render-link.html

Here are examples of how it's been fixed elsewhere:

Note that this template's render-link.html file has deeper problems: see #77.

@kapunahelewong
Copy link
Contributor

kapunahelewong commented Jul 26, 2021

Thank you for this, @chalin. I've opened a PR based on your fix at etcd.io but it's still showing a space. Would you take a look? I'd love any pointers you could share.

#93

kapunahelewong added a commit to kapunahelewong/hugo-netlify-starter that referenced this issue Jul 26, 2021
Fixes cncf#45

Signed-off-by: Kapunahele Wong <[email protected]>
@chalin
Copy link
Collaborator

chalin commented Jul 26, 2021

Would you take a look?

Gladly. I left a comment on the PR.

kapunahelewong added a commit to kapunahelewong/hugo-netlify-starter that referenced this issue Jul 26, 2021
Fixes cncf#45

Signed-off-by: Kapunahele Wong <[email protected]>
@nate-double-u nate-double-u linked a pull request Jul 26, 2021 that will close this issue
kapunahelewong added a commit to kapunahelewong/hugo-netlify-starter that referenced this issue Jul 26, 2021
Fixes cncf#45

Signed-off-by: Kapunahele Wong <[email protected]>
nate-double-u pushed a commit that referenced this issue Jul 26, 2021
Fixes #45

Signed-off-by: Kapunahele Wong <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants