First I thought it was related to the recent SVG XSS fix, but it seems that I can’t get back to a working version, even by reverting everything until 8.15…
Steps to reproduce
Just have some file.rst, insert an image like this:
.. image:: http://some_url/image
What is the current bug behavior?
In gitlab’s file browser, the file is displayed as plain text.
What is the expected correct behavior?
Should be rendered like any other file (markdown or rst)
Link issues together to show that they're related or that one is blocking others.
Learn more.
Activity
Sort or filter
Newest first
Oldest first
Show all activity
Show comments only
Show history only
username-removed-107202changed title from Since 8.16.5, RST files are not properly rendered if they contain an image to Since 8.16.5, RST files are not properly rendered if they contain an SVG image
changed title from Since 8.16.5, RST files are not properly rendered if they contain an image to Since 8.16.5, RST files are not properly rendered if they contain an SVG image
username-removed-107202changed title from Since 8.16.5, RST files are not properly rendered if they contain an SVG image to RST files are not properly rendered if they contain an image
changed title from Since 8.16.5, RST files are not properly rendered if they contain an SVG image to RST files are not properly rendered if they contain an image
I don’t know how and why this broke, but I successfully “fixed” this on my gitlab instance by changing the file vendor/bundle/ruby/2.3.0/gems/gitlab-markup-1.5.1/lib/github/commands like this:
--- rest2html.old 2017-02-16 20:43:29.004451772 +0100+++ rest2html 2017-02-16 20:41:22.214000870 +0100@@ -144,7 +144,8 @@ self.body.pop() # add on `img` with attributes self.body.append(self.starttag(node, 'img', **atts))- self.body.append(self.context.pop())+ if self.context:+ self.body.append(self.context.pop())
Maybe there’s something deeper, but I didn’t try anything else.
Because, without this patch, you get:
% ./rest2html.old .. image:: http://coucouTraceback (most recent call last): File "./rest2html.old", line 196, in <module> sys.stdout.write("%s%s" % (main(), "\n")) File "./rest2html.old", line 182, in main parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS) File "/usr/lib/python2.7/site-packages/docutils/core.py", line 448, in publish_parts enable_exit_status=enable_exit_status) File "/usr/lib/python2.7/site-packages/docutils/core.py", line 662, in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) File "/usr/lib/python2.7/site-packages/docutils/core.py", line 219, in publish output = self.writer.write(self.document, self.destination) File "/usr/lib/python2.7/site-packages/docutils/writers/__init__.py", line 80, in write self.translate() File "/usr/lib/python2.7/site-packages/docutils/writers/_html_base.py", line 71, in translate self.document.walkabout(visitor) File "/usr/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout if child.walkabout(visitor): File "/usr/lib/python2.7/site-packages/docutils/nodes.py", line 187, in walkabout visitor.dispatch_departure(self) File "/usr/lib/python2.7/site-packages/docutils/nodes.py", line 1895, in dispatch_departure return method(node) File "./rest2html.old", line 147, in depart_image self.body.append(self.context.pop())IndexError: pop from empty list
But, I found more: by downgrading from docutils 0.13.1 (was release in december 2016, so not long ago) to 0.12 (2014), my previous ./rest2html example works.
I guess on gitlab.com, docutils=0.12 is installed, but I have 0.13.1 installed (@Eijebong probably has version 0.13.1 too, as he’s using Archlinux on the server, I believe).
Proof:
gitlab@fenouil % cat test.rst.. image:: http://coucougitlab@fenouil % python -c "import docutils; print(docutils.__version__)" 0.13.1gitlab@fenouil % ./rest2html.old test.rstTraceback (most recent call last): File "./rest2html.old", line 196, in <module> sys.stdout.write("%s%s" % (main(), "\n")) File "./rest2html.old", line 182, in main parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS) File "/usr/lib/python2.7/site-packages/docutils/core.py", line 448, in publish_parts enable_exit_status=enable_exit_status) File "/usr/lib/python2.7/site-packages/docutils/core.py", line 662, in publish_programmatically output = pub.publish(enable_exit_status=enable_exit_status) File "/usr/lib/python2.7/site-packages/docutils/core.py", line 219, in publish output = self.writer.write(self.document, self.destination) File "/usr/lib/python2.7/site-packages/docutils/writers/__init__.py", line 80, in write self.translate() File "/usr/lib/python2.7/site-packages/docutils/writers/_html_base.py", line 71, in translate self.document.walkabout(visitor) File "/usr/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout if child.walkabout(visitor): File "/usr/lib/python2.7/site-packages/docutils/nodes.py", line 187, in walkabout visitor.dispatch_departure(self) File "/usr/lib/python2.7/site-packages/docutils/nodes.py", line 1895, in dispatch_departure return method(node) File "./rest2html.old", line 147, in depart_image self.body.append(self.context.pop())IndexError: pop from empty list9:26 gitlab@fenouil % pip install docutils==0.12 --userCollecting docutils==0.12 Using cached docutils-0.12.tar.gzInstalling collected packages: docutils Running setup.py install for docutils ... doneSuccessfully installed docutils-0.13.1gitlab@fenouil % python -c "import docutils; print(docutils.__version__)" 0.12 gitlab@fenouil % ./rest2html.old test.rst <img alt="http://coucou" src="http://coucou" />
Using gitlab v9.1.0-rc3 (although I’m not 100% sure this updates github-markup as well, how do I make sure of this? I install gitlab by cloning the git repository, calling bundle install and all that stuff), this is broken with python-docutils=0.13.1 but it works with python-docutils=0.12.
The installed version of python3-docutils doesn’t change anything.
I haven't released a new "gitlab-markup" gem yet. Will do later today, but I can't promise it will be available in 9.2 as this is working well in omnibus install and I have some higher priority issues to tackle before the feature freeze for 9.2. If you want to try in a source install it should be easily to update the Gemfile and point to 1.6.0 version.
Gabriel Mazettochanged title from RST files are not properly rendered if they contain an image to RST files are not properly rendered if they contain an image (with docutils=0.13.1)
changed title from RST files are not properly rendered if they contain an image to RST files are not properly rendered if they contain an image (with docutils=0.13.1)
There are discussions going on here: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2361 about moving away from docutils to Sphinx. I've asked there if we want to close this in favor of the other, or if we should upgrade the omnibus so we release something for %9.3
GitLab is moving all development for both GitLab Community Edition
and Enterprise Edition into a single codebase. The current
gitlab-ce repository will become a read-only mirror, without any
proprietary code. All development is moved to the current
gitlab-ee repository, which we will rename to just gitlab in the
coming weeks. As part of this migration, issues will be moved to the
current gitlab-ee project.
If you have any questions about all of this, please ask them in our
dedicated FAQ issue.
Using "gitlab" and "gitlab-ce" would be confusing, so we decided to
rename gitlab-ce to gitlab-foss to make the purpose of this FOSS
repository more clear
I created a merge requests for CE, and this got closed. What do I
need to do?
Everything in the ee/ directory is proprietary. Everything else is
free and open source software. If your merge request does not change
anything in the ee/ directory, the process of contributing changes
is the same as when using the gitlab-ce repository.
Will you accept merge requests on the gitlab-ce/gitlab-foss project
after it has been renamed?
No. Merge requests submitted to this project will be closed automatically.
Will I still be able to view old issues and merge requests in
gitlab-ce/gitlab-foss?
Yes.
How will this affect users of GitLab CE using Omnibus?
No changes will be necessary, as the packages built remain the same.
How will this affect users of GitLab CE that build from source?
Once the project has been renamed, you will need to change your Git
remotes to use this new URL. GitLab will take care of redirecting Git
operations so there is no hard deadline, but we recommend doing this
as soon as the projects have been renamed.
Where can I see a timeline of the remaining steps?