[Repoze-dev] [issue103] repoze.bitblt removes doctype

0 views
Skip to first unread message

Brian Sutherland

unread,
Jan 27, 2010, 11:32:35 AM1/27/10
to repoz...@lists.repoze.org

Brian Sutherland <br...@vanguardistas.net> added the comment:

I've just discovered yet another way in which lxml is mangling my HTML. I'm fed up with fixing
around the edges.

So in the next week or so, I will try re-implement regular expressions to find and replace the
<img> tags. Given that malthe seems to think it's a reasonable idea I'll do it inside repoze.bitblt
on a branch first.

So, any ideas on how to robustly find <img> tags in HTML via regexes? Any example
implementations?

Also, what kind of backwards compatibility does repoze.bitblt require? Should I replace the
existing rewrite_image_tags or implement a new one alongside and implement some kind of
configurability into ImageTransformationMiddleware?

__________________________________
Repoze Bugs <bu...@bugs.repoze.org>
<http://bugs.repoze.org/issue103>
__________________________________
_______________________________________________
Repoze-dev mailing list
Repoz...@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Malthe Borch

unread,
Jan 27, 2010, 11:44:52 AM1/27/10
to Repoze Bugs, repoz...@lists.repoze.org
2010/1/27 Brian Sutherland <bu...@bugs.repoze.org>:

> So in the next week or so, I will try re-implement regular expressions to find and replace the
> <img> tags. Given that malthe seems to think it's a reasonable idea I'll do it inside repoze.bitblt
> on a branch first.

Please do it on trunk, and do it well. I've wanted this for a long
time––and for squeeze, too.

> So, any ideas on how to robustly find <img> tags in HTML via regexes? Any example
> implementations?

It's always robust since <img> is never a complex tag.

> Also, what kind of backwards compatibility does repoze.bitblt require? Should I replace the
> existing rewrite_image_tags or implement a new one alongside and implement some kind of
> configurability into ImageTransformationMiddleware?

The primary interface is HTML, so I think we shouldn't worry much
about the actual library code interface. I could be wrong on this
assumption.

\malthe

Brian Sutherland

unread,
Jan 28, 2010, 5:19:10 AM1/28/10
to repoz...@lists.repoze.org

Brian Sutherland <br...@vanguardistas.net> added the comment:

Fixed in revision 8095 by using regexes instead of lxml to parse img tags.

----------
status: chatting -> resolved

__________________________________
Repoze Bugs <bu...@bugs.repoze.org>
<http://bugs.repoze.org/issue103>
__________________________________

Reply all
Reply to author
Forward
0 new messages