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
a10ce2ac
Commit
a10ce2ac
authored
Jun 30, 2017
by
Andrew Xia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add | at end of table column
parent
ce7e3855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
tomd.py
tomd.py
+6
-2
No files found.
tomd.py
View file @
a10ce2ac
...
@@ -48,7 +48,8 @@ BlOCK_ELEMENTS = {
...
@@ -48,7 +48,8 @@ BlOCK_ELEMENTS = {
'p'
:
'<p
\
s.*?>(.*?)</p>'
,
'p'
:
'<p
\
s.*?>(.*?)</p>'
,
'p_with_out_class'
:
'<p>(.*?)</p>'
,
'p_with_out_class'
:
'<p>(.*?)</p>'
,
'thead'
:
'<thead.*?>(.*?)</thead>'
,
'thead'
:
'<thead.*?>(.*?)</thead>'
,
'tr'
:
'<tr>(.*?)</tr>'
'tr'
:
'<tr>(.*?)</tr>'
,
'table'
:
'<table>(.*?)</table>'
}
}
INLINE_ELEMENTS
=
{
INLINE_ELEMENTS
=
{
...
@@ -108,7 +109,10 @@ class Element:
...
@@ -108,7 +109,10 @@ class Element:
elif
self
.
tag
==
'tr'
and
tag
==
'th'
:
elif
self
.
tag
==
'tr'
and
tag
==
'th'
:
self
.
content
=
re
.
sub
(
pattern
,
'|
\
g<1>'
,
self
.
content
.
replace
(
'
\n
'
,
''
))
self
.
content
=
re
.
sub
(
pattern
,
'|
\
g<1>'
,
self
.
content
.
replace
(
'
\n
'
,
''
))
elif
self
.
tag
==
'tr'
and
tag
==
'td'
:
elif
self
.
tag
==
'tr'
and
tag
==
'td'
:
self
.
content
=
re
.
sub
(
pattern
,
'|
\
g<1>'
,
self
.
content
.
replace
(
'
\n
'
,
''
))
self
.
content
=
re
.
sub
(
pattern
,
'|
\
g<1>|'
,
self
.
content
.
replace
(
'
\n
'
,
''
))
# print "---converting, content now:", tag, self.content
self
.
content
=
self
.
content
.
replace
(
"||"
,
"|"
)
#end of column also needs a pipe
# print "---converting, remove duplicate:", tag, self.content
else
:
else
:
wrapper
=
MARKDOWN
.
get
(
tag
)
wrapper
=
MARKDOWN
.
get
(
tag
)
self
.
content
=
re
.
sub
(
pattern
,
'{}
\
g<1>{}'
.
format
(
wrapper
[
0
],
wrapper
[
1
]),
self
.
content
)
self
.
content
=
re
.
sub
(
pattern
,
'{}
\
g<1>{}'
.
format
(
wrapper
[
0
],
wrapper
[
1
]),
self
.
content
)
...
...
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