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 image alignment formatters #72

Open
sronsiek opened this issue Mar 8, 2023 · 0 comments
Open

Issues with image alignment formatters #72

sronsiek opened this issue Mar 8, 2023 · 0 comments

Comments

@sronsiek
Copy link

sronsiek commented Mar 8, 2023

According to the Textile images spec, images can be right or left aligned, or centred:

!>/carver.png!
!</carver.png!
!=/carver.png!

Trying this, using RedCloth 4.3.2:

irb(main):066:0> RedCloth.new( '!>/carver.png!' ).to_html
=> "<p style=\"float:right;\"><img src=\"/carver.png\" alt=\"\" /></p>"

irb(main):067:0> RedCloth.new( '!</carver.png!' ).to_html
=> "<p style=\"float:left;\"><img src=\"/carver.png\" alt=\"\" /></p>"

irb(main):068:0> RedCloth.new( '!=/carver.png!' ).to_html
=> "<p><img src=\"/carver.png\" alt=\"\" /></p>"
  1. RedCloth attempts the right & left alignment, but seems to ignore the centring alignment.
  2. If the input text is preceded by anything, the right & left alignments are ignored:
irb(main):069:0> RedCloth.new( 'Hello!>/carver.png!' ).to_html
=> "<p>Hello<img src=\"/carver.png\" alt=\"\" /></p>"
irb(main):070:0> RedCloth.new( 'Hello\n\n!>/carver.png!' ).to_html
=> "<p>Hello\\n\\n<img src=\"/carver.png\" alt=\"\" /></p>"
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