I followed this example which worked perfectly well a day ago.

I used the LOAD helper for the views.

But when trying to view data from the db I keep getting this error:

Traceback (most recent call last):
  File "/home/maurice/web2py/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File 
"/home/maurice/web2py/applications/riv/views/que_chat/timedscroll6.load", 
line 60, in <module>
    font-size: 18px;
  File "/home/maurice/web2py/gluon/html.py", line 627, in __init__
    text = sanitizer.sanitize(text, permitted_tags, allowed_attributes)
  File "/home/maurice/web2py/gluon/packages/yatl/yatl/sanitizer.py", line 
236, in sanitize
    allowed_attributes=allowed_attributes).strip(text, escape)
  File "/home/maurice/web2py/gluon/packages/yatl/yatl/sanitizer.py", line 
187, in strip
    self.feed(rawstring)
  File "/usr/lib/python3.6/html/parser.py", line 111, in feed
    self.goahead(0)
  File "/usr/lib/python3.6/html/parser.py", line 163, in goahead
    self.handle_data(unescape(rawdata[i:j]))
  File "/home/maurice/web2py/gluon/packages/yatl/yatl/sanitizer.py", line 88
, in handle_data
    if data and not self.in_disallowed[-1]:
IndexError: list index out of range

Having done some ground work I noted that these tags:
</li> <li>
<p></p>
</ol> </ol>
among others were the problem.
The text is posted well to the db but retrieving to view is the issue.
I have used 
model:

ckeditor = CKEditor(db)
ckeditor.settings.url_upload = URL(request.app, 'plugin_ckeditor', 'upload', 
extension='html')
ckeditor.settings.url_browse = URL(request.app, 'plugin_ckeditor', 'browse', 
extension='html')

ckeditor.define_tables()
track_changes(True)

then

ckeditor = CKEditor(db)

ckeditor.define_tables()
track_changes(True)


view:
{{=XML(post.answer)}}

as well as 
{{=XML(post.answer, sanitize=True)}}

and

{{=XML(post.answer, sanitize=False)}}


How do i solve this error?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/32feb9dd-72ee-4412-8f1b-844d30ac7e17%40googlegroups.com.

Reply via email to