Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with custom code blocks #86

Open
Kwpolska opened this issue Jun 23, 2016 · 0 comments
Open

Issues with custom code blocks #86

Kwpolska opened this issue Jun 23, 2016 · 0 comments

Comments

@Kwpolska
Copy link

Kwpolska commented Jun 23, 2016

Nikola is a static site generator. We’re using a custom code block — it works fine with docutils, but with rst2html5 [(plugin)](, there are indentation issues: getnikola/plugins#152

Unfortunately my patch does not cut it, because that breaks tabs (U+0009).

Here’s a gist with a sample post and differences: https://gist.github.com/Kwpolska/a2d4268a08b60df895180f5aa6fd5513

I have tracked the issue down to a difference in self.content for our CodeBlock directive:

.  render_posts:cache/posts/index4.html
N. ['sudo vim /etc/lightdm/lightdm-gtk-greeter.conf']
N. ['[base]', 'session=/usr/bin/startlxde', '...', '[userlist]', 'disable=1']
N. ['foo', 'bar', '             baz (this indented with 3 spaces and 2 tabs)', 'foobar', '    foobaz']
.  render_posts:cache/posts/index.html
N. ['sudo vim /etc/lightdm/lightdm-gtk-greeter.conf']
N. ['[base]', 'session=/usr/bin/startlxde', '...', '[userlist]', 'disable=1']
N. ['foo', 'bar', 'baz (this indented with 3 spaces and 2 tabs)', 'foobar', '    foobaz']

As you can see, we’re missing the indentation of baz. Is this a bug on our side or is this an issue with how rst2html5 parses things?

cc @Netspider, @ralsina

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant