mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-21 06:08:12 +00:00
Merge commit '887e64efd4abbf3980e008c7a5441b44fbd6c766' into glitch-soc/merge-upstream
This commit is contained in:
@@ -129,6 +129,24 @@ RSpec.describe LinkDetailsExtractor do
|
||||
include_examples 'structured data'
|
||||
end
|
||||
|
||||
context 'with the first tag is null' do
|
||||
let(:html) { <<~HTML }
|
||||
<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<script type="application/ld+json">
|
||||
null
|
||||
</script>
|
||||
<script type="application/ld+json">
|
||||
#{ld_json}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
|
||||
include_examples 'structured data'
|
||||
end
|
||||
|
||||
context 'with preceding block of unsupported LD+JSON' do
|
||||
let(:html) { <<~HTML }
|
||||
<!doctype html>
|
||||
|
||||
@@ -224,6 +224,14 @@ RSpec.describe TextFormatter do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when given a URL with trailing @ symbol' do
|
||||
let(:text) { 'https://gta.fandom.com/wiki/TW@ Content' }
|
||||
|
||||
it 'matches the full URL' do
|
||||
expect(subject).to include 'href="https://gta.fandom.com/wiki/TW@"'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when given a URL containing unsafe code (XSS attack, visible part)' do
|
||||
let(:text) { 'http://example.com/b<del>b</del>' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user