Comments (5)
Removed with #39 ... Can you confirm?
from python-creole.
Indeed, the deprecation warnings are gone.
from python-creole.
One of these have i fixed with 97acbc4#diff-7e85869c19954199a320efc15b208cb9
But two still exists. But i haven't find the wrong regexp :(
from python-creole.
These are really tough ones! Especially as the deprecation warning is truncated.
I patchted CPython in sre_parse.py
(at the line with Flags not at the start of the expression
) and now I get the full deprecation warning:
creole/parser/creol2html_parser.py:51
/home/jugmac00/Projects/python-creole/creole/parser/creol2html_parser.py:51: DeprecationWarning: Flags not at the start of the expression '\n \\| \\s*\n (\n (?P<head> [=][^|]+ ) |\n (?P<cell> ( (?P<link>\n \\[\\[\n (?P<link_target>.+?) \\s*\n ([|] \\s* (?P<link_text>.+?) \\s*)?\n ]]\n )|\n (?P<macro_inline>\n << \\s* (?P<macro_inline_start>\\w+) \\s* (?P<macro_inline_args>.*?) \\s* >>\n (?P<macro_inline_text>(.|\\n)*?)\n <</ \\s* (?P=macro_inline_start) \\s* >>\n )\n |(?P<macro_tag>\n <<(?P<macro_tag_name> \\w+) (?P<macro_tag_args>.*?) \\s* /*>>\n )|(?i)(?P<image>\n {{\n (?P<image_target>.+?) \\s*\n (\\| \\s* (?P<image_text>.+?) \\s*)?\n }}\n )|(?P<pre_inline> {{{ (?P<pre_inline_text>.*?) }}} ) | [^|])+ )\n ) \\s*\n '
cell_re = re.compile(x, re.VERBOSE | re.UNICODE)
creole/parser/creol2html_parser.py:55
/home/jugmac00/Projects/python-creole/creole/parser/creol2html_parser.py:55: DeprecationWarning: Flags not at the start of the expression '(?P<link>\n \\[\\[\n (?P<link_target>.+?) \\s*\n ([|] \\s* (?P<link_text>.+?) \\s*)?\n ]]\n )|(?P<url>\n (^ | (?<=\\s))\n (?P<escaped_url>~)?\n (?P<url_target> (?P<url_proto> http|https|ftp|nntp|news|mailto|telnet|file|irc )://[^$\\s]+ )\n )|\n (?P<macro_inline>\n << \\s* (?P<macro_inline_start>\\w+) \\s* (?P<macro_inline_args>.*?) \\s* >>\n (?P<macro_inline_text>(.|\\n)*?)\n <</ \\s* (?P=macro_inline_start) \\s* >>\n )\n |(?P<macro_tag>\n <<(?P<macro_tag_name> \\w+) (?P<macro_tag_args>.*?) \\s* /*>>\n )|(?P<pre_inline> {{{ (?P<pre_inline_text>.*?) }}} )|(?i)(?P<image>\n {{\n (?P<image_target>.+?) \\s*\n (\\| \\s* (?P<image_text>.+?) \\s*)?\n }}\n )|(?P<strong>\\*\\* (?P<strong_text>.+?) \\*\\* )|(?P<emphasis>(?<!:)// (?P<emphasis_text>.+?) (?<!:)// )|(?P<monospace> \\#\\# (?P<monospace_text>.+?) \\#\\# )|(?P<underline> __ (?P<underline_text>.+?) __ )|(?P<superscript> \\^\\^ (?P<superscript_text>.+?) \\^\\^ )|(?P<subscript> ,, (?P<subscript_text>.+?) ,, )|(?P<small>-- (?P<small_text>.+?) -- )|(?P<delete> ~~ (?P<delete_text>.+?) ~~ )|(?P<linebreak> \\\\\\\\ )|(?P<escape> ~ (?P<escaped_char>\\S) )|(?P<char> . )'
inline_re = re.compile('|'.join(INLINE_RULES), INLINE_FLAGS)
So it seems it is the ?i
flag.
When I remove the flag from InlineRules.image
(just for debugging) indeed I get no more deprecation warnings from regex.
As a side note - the tests still pass - so either this flag is not needed at all, or the tests miss a special test case.
Does this help you? Unfortunately, I rarely work with regexes, and especially not with complex ones as here. Without further studying I cannot help here.
from python-creole.
remove the flag from InlineRules.image
(?i)
is re.IGNORECASE
so it can be removed, see also: 97acbc4#commitcomment-36877309
from python-creole.
Related Issues (20)
- macros: source code merge and add <<code>> as default? HOT 1
- easier solution for <<doc>>
- unittests fialed with textile HOT 1
- How to use python-creole python module in my project HOT 2
- No such file or directory: 'LICENSE' HOT 1
- (ERROR/3) Undefined substitution referenced HOT 4
- Fail to install with python 3.5 HOT 1
- I have written a mild extension to allow image size HOT 3
- Test failures for Python 3.6 HOT 6
- Provide `tox.ini` for easier local testing HOT 6
- Don't copy README.creole to $PWD HOT 2
- docutils dependency causing conflict with botocore HOT 4
- Travis is broken HOT 1
- Tox is broken HOT 2
- Classifier for Python 3.9 is missing HOT 1
- Travis-ci.org shuts down at the end of the year HOT 4
- Fix tests with Python 3.10
- creole2html using blog_line_breaks=False breaks headlines
- creole2html cannot be used for standard creole 1.0 for linebreaks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-creole.