Skip to content

Commit

Permalink
feat: add wrapper for version labels (#9264)
Browse files Browse the repository at this point in the history
Refs #9167
  • Loading branch information
tekyu committed Sep 28, 2023
1 parent 5e7bde9 commit 1addcfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/core/components/info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ class Info extends React.Component {
<hgroup className="main">
<h2 className="title">
{title}
{version && <VersionStamp version={version} />}
<OpenAPIVersion oasVersion="2.0" />
<span>
{version && <VersionStamp version={version} />}
<OpenAPIVersion oasVersion="2.0" />
</span>
</h2>
{host || basePath ? (
<InfoBasePath host={host} basePath={basePath} />
Expand Down
2 changes: 1 addition & 1 deletion test/unit/xss/info-sanitization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("<Info/> Sanitization", function(){

it("renders sanitized .title content", function(){
let wrapper = render(<Info {...props}/>)
expect(wrapper.find(".title").html()).toEqual("Test Title **strong** &lt;script&gt;alert(1)&lt;/script&gt;")
expect(wrapper.find(".title").html()).toEqual("Test Title **strong** &lt;script&gt;alert(1)&lt;/script&gt;<span></span>")
})

it("renders sanitized .description content", function() {
Expand Down

0 comments on commit 1addcfe

Please sign in to comment.