Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tomd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Чумбаев Максим
tomd
Commits
476e938a
Commit
476e938a
authored
Nov 07, 2017
by
zsinx6
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed strong with spaces after or before
parent
f030dcfd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
test_tomd.py
test_tomd.py
+1
-0
tomd.py
tomd.py
+5
-2
No files found.
test_tomd.py
View file @
476e938a
...
...
@@ -34,6 +34,7 @@ string = """
<b><i>bold italic</i></b>
<em>em</em>
<strong>strong</strong>
<strong> strong </strong>
</p>
<hr/>
...
...
tomd.py
View file @
476e938a
...
...
@@ -75,7 +75,7 @@ INLINE_ELEMENTS = {
'img_single_no_close'
:
'<img.*?src="(.*?)".*?>'
,
'a'
:
'<a.*?href="(.*?)".*?>(.*?)</a>'
,
'em'
:
'<em.*?>(.*?)</em>'
,
'strong'
:
'<strong.*?>(
.*?
)</strong>'
,
'strong'
:
'<strong.*?>(
\
s*)(.*?)(
\
s*
)</strong>'
,
'tbody'
:
'<tbody.*?>((.|
\n
)*)</tbody>'
,
}
...
...
@@ -166,6 +166,9 @@ class Element:
self
.
construct_table
()
else
:
wrapper
=
MARKDOWN
.
get
(
tag
)
if
tag
==
"strong"
:
self
.
content
=
re
.
sub
(
pattern
,
'{}
\
g<2>{}'
.
format
(
wrapper
[
0
],
wrapper
[
1
]),
self
.
content
)
else
:
self
.
content
=
re
.
sub
(
pattern
,
'{}
\
g<1>{}'
.
format
(
wrapper
[
0
],
wrapper
[
1
]),
self
.
content
)
if
self
.
tag
==
"e_p"
and
self
.
content
[
-
1
:]
!=
'
\n
'
and
len
(
self
.
content
)
>
2
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment