Source code: orphan closing tags

(Rdiepenbrock) #1

I am seeing this code in the browser page source. Also seeing orphan closing tags when I paste my hub URL in Slack.
In the Head tag, the meta name=description content attribute appears to be left open. See below:

<meta property="og:type" content="website" id="og:type"/><meta name="description" content="


    " id="description" data-react-helmet="true"/><meta property="og:description" content="


    " id="og:description" data-react-helmet="true"/>
(Taylor Barnett) #2

Have you set any of the meta data in the Hub Settings?

(Rdiepenbrock) #3

Hub settings:
Hub-Settings-1 Hub-Settings-2

(Rdiepenbrock) #4

Even if the meta data wasn’t added, there shouldn’t be that kind of breakage in the code (if it’s actually breaking).

(Taylor Barnett) #5

@rdiepenbrock I took a look at what it shows for your docs when I posted it in our Slack, it appears that some of your custom code is getting in there. We had this issue with another user who was doing a bunch of custom JavaScript and HTML. I’ve gone back to the issue to add more details.

They might have found a work around, but I am having trouble remembering. Either way, I’ll make sure an issue is opened with the engineering team to try to get added to a future sprint.

@tatiana.perry were you having an issue where your meta data wasn’t showing when you linked your docs, instead of bunch of code was showing? Were you able to find a workaround? I don’t believe it is still happening.

(Taylor Barnett) #6

I dug into the ticket for this and found out this from one of the engineers at Stoplight:

The only issue I see is that if you only have a <script> tag and no other content, a meta description cannot be produced. To get around this they added a <meta name=”description” content=”…”></meta> along side their script.

Maybe this could be a workaround for you too, @rdiepenbrock?

(Rdiepenbrock) #7

Add the extra meta tag to the custom Javascript block in the Publish section? Or, add it next to every script tag I have on each page?

(Taylor Barnett) #8

In the past, we only saw this happening on HTML pages that didn’t contain any other text content, only scripts. So I am not sure if it is happening only in the same places for you or not. I would try adding it first to some of the script tags on pages where you see this happening. It might not need to be on every one of the pages.

(Rdiepenbrock) #9

I am using HTML pages, such as User Manual, and also the embed method for a few pages, ie. the landing page.

In the HTML pages, I am adding a script block at the bottom of the page, after the content.
On the embed pages, I am adding an HTML section at the bottom and pasting the script block there.
It is this script block that appears in the header tag, mixed in with the meta data and the custom JavaScript block (the try-catch).

(Tatiana Perry) #10

It’s not happening anymore. We added added a meta tag at the beginning of the page.

(Taylor Barnett) #11

If adding in a meta tag at the beginning of the pages doesn’t work, I’ll take your exact docs to the engineering team to see if they can figure out a workaround.

(Rdiepenbrock) #12

Did not fix the embedded pages.
The source for the HTML pages changed, but now I’m getting a block of import com.mashape.unirest.http.HttpResponse;

Attached screenshot of source code. The first image is the issue, the second is the meta tag I added to the page (Mailgun API Documentation).

stoplight_Documentation_Source1 stoplight_Documentation_Source2

(Taylor Barnett) #13

After talking to one of the engineers who came up with the workaround, it appears it was only a suggestion for HTML pages, not the pages with HTML embedded in it.

Is there a particular reason for using embedded HTML on some of those pages where it looks like you are only using HTML?

(Rdiepenbrock) #14

Been out of the office for about a week. Jumping back in here.
For my top level pages, I set the Page Type to Embedded and then use blocks to add content, HTML or JavaScript.
Top level pages: Docs Home, User Guide, API Reference.
The rest of the pages are Page Type: HTML. And I reference those links to pages uploaded to the site via the Project Designer.

(Taylor Barnett) #15

I was a bit curious about the decision to use embedded over HTML pages with JS in them. I haven’t looked at all of your pages, but it seemed doable on some and might help with this issue.

(Rdiepenbrock) #16

What is the general practice with this app? What is suggested for embedded pages vs HTML?

(Taylor Barnett) #17

That’s a good question. We could probably make this more clear, but you should always use an HTML page over an embedded page. Only reason to use embedded is if you need to also include some other block type on the page such as the request maker, markdown, etc.

A bit of history: HTML and embedded pages were not released at the same time. Each have their own use cases, so this might explain the gap in the experience in using both of them.

(Rdiepenbrock) #18

I’ve added a meta tag to all the HTML pages. The issue has not resolved.

(Taylor Barnett) #19

I’ve reopened an older issue on this internally and will see if there are other workarounds. Could you message me in a private message a link to one of the HTML pages in Stoplight where you added the tags?

(Rdiepenbrock) #20

This appears to be fixed and working as expected. Thanks!

1 Like