You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I was looking at #138, I noticed in the codebase that the issue around decoding was already addressed for HTMLParser class (Modest impl), but not for LexborHMLParser (Lexbor impl).
Also it can be error prone, having to check two different places. So to make it easier to maintain, preferably there would be a single source of truth for the public API, while the implementation-specific C code would be abstracted away.
It could look maybe something like this:
classModestParserImpl:
defget_body(self, myhtml_tree_t* html_tree):
cdef myhtml_tree_node_t* body
body = myhtml_tree_get_node_body(html_tree)
return body
classLexborParserImpl:
...
classHTMLParserABC:
self.impl =None@propertydefbody(self):
cdef myhtml_tree_node_t* body
body =self.impl.get_body(self.html_tree)
if body !=NULL:
node = Node()
node._init(body, self)
return node
returnNoneclassHTMLParser(HTMLParserABC):
impl = ModestParserImpl()
classHTMLParser(HTMLParserABC):
self.impl = ParserImpl(self)
The text was updated successfully, but these errors were encountered:
As I was looking at #138, I noticed in the codebase that the issue around decoding was already addressed for
HTMLParser
class (Modest impl), but not for LexborHMLParser (Lexbor impl).Also it can be error prone, having to check two different places. So to make it easier to maintain, preferably there would be a single source of truth for the public API, while the implementation-specific C code would be abstracted away.
It could look maybe something like this:
The text was updated successfully, but these errors were encountered: