fix: anchor tag safety (via #4789)
* v3.17.6 * release(3.17.6): rebuild dist * add failing tests * fix Link component * fix OnlineValidatorBadge component * switch from <a> to <Link> in operation components * make Markdown inputs safe * use Link component in Info block, for target safety * add eslint rule for unsafe `target` usage
This commit is contained in:
@@ -99,6 +99,7 @@ export default class Operation extends PureComponent {
|
||||
const OperationServers = getComponent( "OperationServers" )
|
||||
const OperationExt = getComponent( "OperationExt" )
|
||||
const OperationSummary = getComponent( "OperationSummary" )
|
||||
const Link = getComponent( "Link" )
|
||||
|
||||
const { showExtensions } = getConfigs()
|
||||
|
||||
@@ -134,7 +135,7 @@ export default class Operation extends PureComponent {
|
||||
<span className="opblock-external-docs__description">
|
||||
<Markdown source={ externalDocs.description } />
|
||||
</span>
|
||||
<a target="_blank" className="opblock-external-docs__link" href={ sanitizeUrl(externalDocs.url) }>{ externalDocs.url }</a>
|
||||
<Link target="_blank" className="opblock-external-docs__link" href={sanitizeUrl(externalDocs.url)}>{externalDocs.url}</Link>
|
||||
</div>
|
||||
</div> : null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user