jquery-pjax
jquery-pjax copied to clipboard
SVG <title> elements replace the page title
If the page contains inline SVG with a <title>, it will get used instead of the main <title> for the page title.
For example, a page returned with the following, will be be titled 'SVG Title'
<title>Page title</title>
<svg width="500" height="300" xmlns="http://www.w3.org/2000/svg">
<g>
<title>SVG Title</title>
<rect x="10" y="10" width="200" height="50"
style="fill:none; stroke:blue; stroke-width:1px"/>
</g>
</svg>
This happens because the last title in the page is used:
// If there's a <title> tag in the header, use it as
// the page's title.
obj.title = findAll($head, 'title').last().text()
@mislav as we also run into this problem I would provide a patch for this problem.
would it be enought to use the first() title instead of the last one? or maybe only take <title> attributes into accounts of top level elements?
Upstream PR erstellt