-
Notifications
You must be signed in to change notification settings - Fork 886
Description
@waylan I had a question about an approach I wanted to run by you, and your general opinion on which direction you'd like me to take for a pull.
Recently you accepted a pull to fix table backticks. In that pull, I hadn't realized that Python Markdown doesn't currently allow for the escape of |
in Tables
, but the logic I added accounts for it. PHP Markdown Extra does allow this (which makes sense based on the sytax Tables
adds). So in general, I would call this a bug, but before I continue, I want to make sure that this is something you want to address, or if you consider this a feature/enhancement that you would prefer not to introduce into the 2.6 series. In that case, I would just issue a pull to remove the logic that accounts for \|
and be done.
If you do consider the handling of |
to be a bug. The fix is pretty easy, but I wanted to ask about the approach.
-
I could just inject an escape pattern for
|
and call it done. -
We could append
|
to the current escape list and let the current escape pattern handle it. The reason why I like this is that an extension can just see what's already in that list and avoid adding redundant escapes that have already been added by a previous extension. The only issue with this is that a global list is used in the Markdown class. It would be nice if we copied the global array for that instance of Markdown instead so that you could append and not modify the global. I think regardless of whether it is a condoned approach to append to that list, it should probably not be a global copy to protect against people's monkey patching. At the very least make it a tuple so people would have to physically construct a new one if they tried to modify it.
In short:
-
Do you want to handle escaped
|
for Extra Tables? -
If so, which approach would you prefer?
Based on your response, I will take the appropriate action.