max99x / dict-lookup-chrome-ext

Look up any word in an inline frame with a simple click and without leaving the page.
https://chrome.google.com/webstore/detail/ipdjaafajlfiopcppipdinmcjbcpofhd
18 stars 7 forks source link

Problems with HTML entities in examples #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open definition for 'dog'

What is the expected output? What do you see instead?
For a slang definition "feet" quotes around the first example are truncated. 
The issue is probably in RE_EXAMPLE_BREAK regex, which does not include "&" 
symbol: 

RE_EXAMPLE_BREAK = re.compile(r'(?:^|(?<=[^\w<])(?<!\[\[))(?=[<\[\'"\w])(.+)', 
re.UNICODE). 

Using your wiktionaryparser for my own project, I've changed it like this: 

RE_EXAMPLE_BREAK = 
re.compile(r'(?:^|(?<=[^\w<])(?<!\[\[))(?=[<\[\'"\w\&])(.+)', re.UNICODE) 

Hope that is useful.

Original issue reported on code.google.com by matvey.m...@gmail.com on 20 Jan 2011 at 1:06

GoogleCodeExporter commented 9 years ago
Although I couldn't reproduce the exact example you provided, the fix does make 
sense and I incorporated it into Revision 53. If you're still using the 
Wiktionary parser, you might want to look into that revision as I've cleaned up 
and documented all the code now.

Original comment by max99x on 12 Feb 2011 at 6:39