Patch #894
closedPatch for #893
100%
Description
This fixes #893, wiki links not working in tables. I considered monkey-patching redcloth, and I considered sending the patch to _why for redcloth, but apparently that project is unmaintained, so maybe it's ok to touch redcloth.rb. This patch uses a negative lookahead to not split on a pipe that's followed by two consecutive close-brackets, the closing markup for a wiki link. I tried matching both sides (open and close brackets) but MRI's regexp engine doesn't support negative lookbehinds, and I think it's safe to assume there's no other reason you'd have ]] in a table cell.
Files
Updated by Jean-Philippe Lang over 16 years ago
Only wiki links with pipes do not work in tables, but simple wiki links (without pipes) work.
Example with simple wiki links:
Guide | Cell |
Cell | RedmineInstall |
This patch fixes links with pipes, but it breaks simple wiki links that do not use pipes.
Updated by Jean-Philippe Lang over 16 years ago
This seems to fix both:
row.split( /\|(?![^\[\|]*\]\])/ ).each do |cell|
Updated by Jean-Philippe Lang over 16 years ago
- File wiki_links_in_tables-1.diff added
New patch attached.
Updated by Jean-Philippe Lang over 16 years ago
- File deleted (
wiki_links_in_tables-1.diff)
Updated by Jean-Philippe Lang over 16 years ago
Updated by Rocco Stanzione over 16 years ago
Your fix looks pretty good. Didn't occur to me to test with no-pipe wiki links. Thanks!
Updated by John Goerzen over 16 years ago
Weird that it shows JP's patch as 54 bytes. Looks like it was 540 bytes to me. Is that a bug? :-)
Updated by Rocco Stanzione over 16 years ago
Rails bug! number_to_human_size drops trailing 0's, and jplang's patch is 540 bytes.
Updated by Rocco Stanzione over 16 years ago
FWIW it's fixed in Rails in http://dev.rubyonrails.org/changeset/8774 and merged in the 2-0-stable branch.
Updated by Jean-Philippe Lang over 16 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset r1280.