Project

General

Profile

Actions

Defect #13723

closed

Collapse doesn't work with section edit link

Defect #13723: Collapse doesn't work with section edit link

Added by Vadim Pushtaev over 13 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
Text formatting
Target version:
Resolution:
Fixed
Affected version:

Description

Collapsed with collapse macro sections don't have an edit link. More than this, all following edit links don't work properly, because service-side numeration take into account all sections, even collapsed, but client-side doesn't.


Files


Related issues 2 (0 open — 2 closed)

Related to Redmine - Defect #26974: Collapse macro conflicts with header section edit buttonsClosedActions
Has duplicate Redmine - Defect #44164: Edit link is missing or incorrect in Wiki pages with the collapse macroClosedActions

Updated by Vadim Pushtaev about 13 years ago Actions #1

I can't reproduce the “more than this” part.

Considering the first part. Here is what we have in app/helpers/application_helper.rb (line 527):

macros = catch_macros(text)
#...
parse_sections(text, project, obj, attr, only_path, options)

catch_macros is a mutator, all instances of {{ macro ... }} in text are placed with {{macro(N)}}, so there is no chance parse_sections can see <h1>... inside. I don't know whether it was made on purpose or not, but I believe you can reject this issue.

Updated by Asaf H almost 13 years ago Actions #2

It happens to me as well (the part before the "more than this").
Is there a reason you suggested rejecting this issue?

Updated by Vadim Pushtaev almost 13 years ago Actions #3

It's not exactly a bug, it looks more like a feature.

Updated by Asaf H almost 13 years ago Actions #4

Maybe an unavoidable behavior, but a feature?
If there are sections inside a collapser, why shouldn't the user be able to edit them?
I think it's best if the formatter treats the collapse as a section. That way you can edit the entire collapse, or any section within it, same as you would any section.

Updated by Vadim Pushtaev almost 13 years ago Actions #5

Yeah, it would be perfect and natural, but unfortunately macros are just not made this way.

Updated by Toshi MARUYAMA about 9 years ago Actions #6

  • Related to Defect #26974: Collapse macro conflicts with header section edit buttons added

Updated by Marcin Szewczyk over 3 years ago Actions #7

Hi, in the 5.0.3 version the problem is still present. I attach a one-line patch that I intend to test on production (5.0.3) someday soon. For now I've tested it with version 4.2.3. app/helpers/application_helper.rb doesn't contain many changes between those versions so the patch should be still relevant. Testing via wiki edition (headings inside collapse, headings with inline code, TOC), running rake test and ruby test/helpers/application_helper_test.rb suggests it's OK. Although, I must admit that I may be missing something as I don't understand how the patch from r8841 fixed some of the problems. My ruby skills are almost nonexistent so I'm probably missing some scope nuances.

Updated by Go MAEDA over 3 years ago Actions #8

I have confirmed the issue and the patch posted in #note-7 fixes the issue.

Wiki page content:

h1. Test-13723

{{collapse
h2. foo

The quick brown fox jumps over the lazy dog.
}}

h2. bar

test test

With the patch applied:

Updated by Marius BĂLTEANU 6 months ago Actions #9

  • Has duplicate Defect #44164: Edit link is missing or incorrect in Wiki pages with the collapse macro added

Updated by Marius BĂLTEANU 6 months ago Actions #10

I've added a test to the existing patch which still works.

Updated by Marius BĂLTEANU 6 months ago Actions #11

  • Target version changed from Candidate for next minor release to 6.0.11

Updated by Marius BĂLTEANU 5 months ago Actions #12

  • Status changed from Confirmed to Resolved
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed

Updated by Marius BĂLTEANU 5 months ago Actions #13

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom