mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	## Description Fix for issue #2361 : replace &, <, >, " with &amp; , &lt; , &gt; , &quot; in before rendering svg ## Checklist <!--- Before you submit the PR, go over this checklist and make sure you can tick off all the boxes. [] -> [x] --> - [x] I have submitted the spaCy Contributor Agreement. - [ ] I ran the tests, and all new and existing tests passed. (As discussed in the comments to #2361) - [x] My changes don't require a change to the documentation, or if they do, I've added all required information.
		
			
				
	
	
		
			15 lines
		
	
	
		
			361 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			361 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from __future__ import unicode_literals
 | 
						|
import pytest
 | 
						|
 | 
						|
from ...displacy import render
 | 
						|
from ..util import get_doc
 | 
						|
 | 
						|
def test_issue2361(de_tokenizer):
 | 
						|
    tokens = de_tokenizer('< > & " ')
 | 
						|
    html = render(get_doc(tokens.vocab, [t.text for t in tokens]))
 | 
						|
 | 
						|
    assert '<' in html
 | 
						|
    assert '>' in html
 | 
						|
    assert '&' in html
 | 
						|
    assert '"' in html
 |