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

Rendering of lists #38

Closed
adiel-mittmann opened this issue Apr 5, 2012 · 5 comments
Closed

Rendering of lists #38

adiel-mittmann opened this issue Apr 5, 2012 · 5 comments

Comments

@adiel-mittmann
Copy link
Contributor

As mentioned in another issue, there are problems rendering lists. I forked your code and rewrote render_list_data() to fix it. I can't prove it works in all cases, but it does work for these:

== 1 ==
* a
** b
*#* c
*** x

==2==
# one
#* eee
#* eee
# two
# three

==3==
# a
# b
#* c
# d
# e
#* f
#* g
#* h
#* i
# j
#* k
# l
#* m

==4==
:# a
:# b
:#: c
:# d

The above lists generate element for element the same results as MediaWiki. Feel free to incorporate the changes into your branch.

@nricciar
Copy link
Owner

nricciar commented Apr 5, 2012

This looks broken still for me. For example the 2nd example you get...

<ol><li>one<ul><li>eee</><>eee</li></ul></><>two</><>three</li></ol>

as you can see its rendering the content with empty html elements.

@nricciar
Copy link
Owner

nricciar commented Apr 5, 2012

I have merged your changes in along with a minor fix to fix the empty element issue.

@nricciar nricciar closed this as completed Apr 5, 2012
@adiel-mittmann
Copy link
Contributor Author

That's not the result I'm getting here. This is what it produces:

<ol><li>one<ul><li>eee</li><li>eee</li></ul></li><li>two</li><li>three</li></ol>

Did you get a clean copy of my repository? I'm new to GitHub, so I'm not sure if forking your project and telling you about it was the proper way of doing things :P

@nricciar
Copy link
Owner

nricciar commented Apr 5, 2012

Looks like ruby1.9 has different results with pieces[-1] compared to 1.8. pieces[-1,1] seems to be compatible with both versions.

@adiel-mittmann
Copy link
Contributor Author

That explains it. I did not test it in Ruby 1.8.

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

2 participants