Opened 9 years ago

Closed 6 years ago

# [Patch] Previewing the edited section shows the whole page, instead of showing the preview of just the edited section.

Reported by: Owned by: Mark Kharitonov Catalin BALAN high SectionEditPlugin major 0.11

### Description

I am editing a section using the edit button enabled by the plugin. When I wish to preview my changes, the previewer displays the whole page, instead of just the section being edited. This is clearly a bug, because it effectively terminates the usefulness of the feature.

### comment:1 Changed 9 years ago by Mark Kharitonov

Summary: Previewing the edited section shows the whole page, instead showing just the preview of the just the edited section. → Previewing the edited section shows the whole page, instead showing the preview of just the edited section.

### comment:2 Changed 9 years ago by Mark Kharitonov

Summary: Previewing the edited section shows the whole page, instead showing the preview of just the edited section. → Previewing the edited section shows the whole page, instead of showing the preview of just the edited section.

### comment:3 Changed 9 years ago by Michael Ching

Attached patch which adds "preview_whole_page" setting. When set to false, the preview is restricted to the section being modified only.

### comment:5 Changed 9 years ago by Mark Kharitonov

Thanks mkc. Works great, although I would suggest (and that's what I actually did on my trac install) to change the default of preview_whole_page from True to False, since it makes more sense to preview just the section when editing just the section. Are you going to merge the change in the trunk for the plugin? Because currently it is not there. Thanks, again.

### comment:6 Changed 9 years ago by anonymous

The patch works and really enhances usability. Sadly, the Image macro does not work in the section preview. The error is

 sequence item 0: expected string, NoneType found

### comment:7 Changed 9 years ago by Ryan J Ollos

I can confirm the same problem with the Image macro.

### comment:8 Changed 9 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; ryano@… removed

### comment:9 Changed 8 years ago by Ryan J Ollos

Summary: Previewing the edited section shows the whole page, instead of showing the preview of just the edited section. → [Patch] Previewing the edited section shows the whole page, instead of showing the preview of just the edited section.

Hello cbalan,

Would it be possible to have this integrated into the repository? I'd like to provide some additional fixes for this plugin and it will be more straightforward than to have multiple patches that are dependent on one another.

### comment:10 follow-up:  11 Changed 8 years ago by Ryan J Ollos

One issue with the patch is that it sometimes causes the last line in the section to be replicated.

For instance, suppose my section is composed of:

line1
line2
line3
line4

After several edits and saves, I end up with something like:

line1
line2
line3
line4
line4
line4

However, the number of times the line is replicated doesn't seem to directly correspond to the number of saved revisions.

### comment:11 in reply to:  10 Changed 8 years ago by Ryan J Ollos

One issue with the patch is that it sometimes causes the last line in the section to be replicated.

Someone reported this behavior in #6169, so it may be unrelated to this patch.

### comment:12 follow-up:  13 Changed 8 years ago by Catalin BALAN

(In [7117]) Applied preview whole page patch. Thank you mkc, rjolls. Refs #4848

### comment:13 in reply to:  12 ; follow-ups:  14  15  16 Changed 8 years ago by Catalin BALAN

Status: new → assigned

(In [7117]) Applied preview whole page patch. Thank you mkc, rjolls. Refs #4848

Hey Guys,

What do you think about moving the preview_whole_page option to wiki edit page ? In this way, the user could switch the preview whole page on and off while editing/previewing

Thank you, Catalin Balan

### comment:14 in reply to:  13 Changed 8 years ago by Ryan J Ollos

Cc: anonymous added; Ryan J Ollos removed

Replying to cbalan: What do you think about moving the preview_whole_page option to wiki edit page ? In this way, the user could switch the preview whole page on and off while editing/previewing

I'd find that feature to be useful.

### comment:15 in reply to:  13 Changed 8 years ago by Ryan J Ollos

What do you think about moving the preview_whole_page option to wiki edit page ? In this way, the user could switch the preview whole page on and off while editing/previewing

Would it be alright with you if we closed this ticket and opened another for this additional feature? That way it will be obvious to anyone that the patch has been incorporated into the trunk.

### comment:16 in reply to:  13 ; follow-up:  18 Changed 8 years ago by Ryan J Ollos

What do you think about moving the preview_whole_page option to wiki edit page ? In this way, the user could switch the preview whole page on and off while editing/previewing

I've been thinking about this. It might be better to add a Preview Section button next to the Preview Page button, rather than having a checkbox to toggle preview section / page.

Currently we have:

We could have:

Preview Page | Preview Section | Review Changes

### comment:17 Changed 8 years ago by Ryan J Ollos

Well, image didn't seem to upload correctly, but I'm sure you get the idea.

### comment:18 in reply to:  16 Changed 6 years ago by Ryan J Ollos

Resolution: → fixed assigned → closed

I've been thinking about this. It might be better to add a Preview Section button next to the Preview Page button, rather than having a checkbox to toggle preview section / page.

The preview page button seems like feature bloat. If the user chooses to edit a section, they should only see that section when previewing.

### Modify Ticket

Change Properties