-
Bug
-
Resolution: Fixed
-
Minor
-
2.7.4, 2.8, 2.8.4, 3.1.2
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_31_STABLE
-
MOODLE_32_STABLE, MOODLE_33_STABLE
-
MDL-49988_fix_wiki_preview -
Problem:
If the html- code of a wiki page contains line breaks, these are not shown in the preview (expected behaviour). But when viewing the page after it is saved, unexpected line breaks occur in the view.
To reproduce the problem (tested on demo.moodle.org):
1. Create a new wiki page in html format
2. Make sure you use atto as editor (not TinyMCE)
3. Open the html view of the editor and insert text a text and hit [ENTER] to insert new lines (do not insert <br/>).
4. Leave the html view. As expected, the WYSIWYG editor now shows a single line of text.
5. Hit the preview button.
6. The wiki preview shows a single line of text.
7. Save and view the wiki page: It contains line break whenever you inserted a new line within the html-editor.
This problem does not occur with TinyMCE as it removes new lines from the html code.
Quickfix:
Within Mod/wiki/locallib.php: wiki_print_page_content change FORMAT_MOODLE to FORMAT_HTML when calling method format_text
The general problem: the Wiki format does not use a single method for rendering a page. E.G see mod/wiki/pagelib.php:[class]page_wiki_preview:print_preview() has a different behaviour when previewing a page.