Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
d4876cd3
Commit
d4876cd3
authored
Dec 13, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web: mhtml: fix "?display=" image conversion
/reviewed-on
nexedi/erp5!210
parent
4d1e667c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_convertHtmlToSingleFile.py
...tem/portal_skins/erp5_web/Base_convertHtmlToSingleFile.py
+1
-0
product/ERP5/tests/testERP5WebWithDms.py
product/ERP5/tests/testERP5WebWithDms.py
+9
-5
No files found.
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_convertHtmlToSingleFile.py
View file @
d4876cd3
...
...
@@ -169,6 +169,7 @@ def handleImageSourceObject(obj, src):
if
key
==
"format"
and
value
is
not
None
:
format_kw
[
"format"
]
=
value
elif
key
==
"display"
and
value
is
not
None
:
format_kw
.
setdefault
(
"format"
,
""
)
format_kw
[
"display"
]
=
value
if
format_kw
:
mime
,
data
=
obj
.
convert
(
**
format_kw
)
...
...
product/ERP5/tests/testERP5WebWithDms.py
View file @
d4876cd3
...
...
@@ -1371,6 +1371,7 @@ return True
page
.
edit
(
text_content
=
""
.
join
([
"<p>Hello</p>"
,
'<img src="%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="%s?display=" />'
%
svg
.
getRelativeUrl
(),
'<img src="/%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="//test.portal.erp/%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="http://test.portal.erp/%s?format=" />'
%
svg
.
getRelativeUrl
(),
...
...
@@ -1389,7 +1390,7 @@ return True
"<p>Hello</p>"
,
]
+
([
'<img src="data:image/svg+xml;base64,%s" />'
%
b64encode
(
XSMALL_SVG_IMAGE_ICON_DATA
),
]
*
5
)
+
[
]
*
6
)
+
[
'<img src="%s//example.com/%s?format=" />'
%
(
protocol
,
svg
.
getRelativeUrl
()),
'<img src="http://example.com/%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="https://example.com/%s?format=" />'
%
svg
.
getRelativeUrl
(),
...
...
@@ -1412,6 +1413,7 @@ return True
page
.
edit
(
text_content
=
""
.
join
([
"<p>Hello</p>"
,
'<img src="%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="%s?display=" />'
%
svg
.
getRelativeUrl
(),
'<img src="/%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="//test.portal.erp/%s?format=" />'
%
svg
.
getRelativeUrl
(),
'<img src="http://test.portal.erp/%s?format=" />'
%
svg
.
getRelativeUrl
(),
...
...
@@ -1434,6 +1436,7 @@ return True
""
.
join
([
"<p>Hello</p>"
,
'<img src="%s/%s?format=" />'
%
(
page
.
absolute_url
(),
svg
.
getRelativeUrl
()),
'<img src="%s/%s?display=" />'
%
(
page
.
absolute_url
(),
svg
.
getRelativeUrl
()),
'<img src="%s?format=" />'
%
svg
.
absolute_url
(),
'<img src="%s//test.portal.erp/%s?format=" />'
%
(
protocol
,
svg
.
getRelativeUrl
()),
'<img src="http://test.portal.erp/%s?format=" />'
%
svg
.
getRelativeUrl
(),
...
...
@@ -1448,10 +1451,11 @@ return True
)
for
message
,
location
in
[
(
message
.
get_payload
()[
1
],
"%s/%s?format="
%
(
page
.
absolute_url
(),
svg
.
getRelativeUrl
())),
(
message
.
get_payload
()[
2
],
"%s?format="
%
svg
.
absolute_url
()),
(
message
.
get_payload
()[
3
],
"%s//test.portal.erp/%s?format="
%
(
protocol
,
svg
.
getRelativeUrl
())),
(
message
.
get_payload
()[
4
],
"http://test.portal.erp/%s?format="
%
svg
.
getRelativeUrl
()),
(
message
.
get_payload
()[
5
],
"https://test.portal.erp/%s?format="
%
svg
.
getRelativeUrl
()),
(
message
.
get_payload
()[
2
],
"%s/%s?display="
%
(
page
.
absolute_url
(),
svg
.
getRelativeUrl
())),
(
message
.
get_payload
()[
3
],
"%s?format="
%
svg
.
absolute_url
()),
(
message
.
get_payload
()[
4
],
"%s//test.portal.erp/%s?format="
%
(
protocol
,
svg
.
getRelativeUrl
())),
(
message
.
get_payload
()[
5
],
"http://test.portal.erp/%s?format="
%
svg
.
getRelativeUrl
()),
(
message
.
get_payload
()[
6
],
"https://test.portal.erp/%s?format="
%
svg
.
getRelativeUrl
()),
]:
self
.
assertEqual
(
message
.
get
(
"Content-Location"
),
...
...
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