Wikidocs change line blocks and code blocks
Describe your issue
After using WikiDocs for a while, I noticed that Wikidocs on sometimes on edit/save change code inside line block and code blocks.
Device and settings
Windows 10
Steps to reproduce
1. Clean WikiDocs Installation
Image: WikiDocs clean installation
2. Backslash Error
# Call the function to create a backup
create_backup
LOG_FILE="$backup_file"
# Add logo to log
echo " _______ _______ " >> $LOG_FILE
echo " (\ ( ___ ) ( ____ \ " >> $LOG_FILE
echo " | ) | ( ) | | ( _\/ " >> $LOG_FILE
echo " | | | | | | | (_____ " >> $LOG_FILE
echo " | | | | | | | ___ \ " >> $LOG_FILE
echo " | | | | | | | ( ) | " >> $LOG_FILE
echo " | (____ | (___) | | (___) | " >> $LOG_FILE
echo " (______) (_______) (_______) bY aaa " >> $LOG_FILE
echo "" >> $LOG_FILE
echo "[$(date +"%Y-%m-%d %H:%M:%S")]" >> $LOG_FILE
sleep 1
read -p "Log file $LOG_FILE created successfully! Press Enter to continue..."
Image before saving
Image after saving (browser view)
Image after saving (content.md file)
WikiDocs converts
\to \textbackslash on the first save inside code blocks.
3. HTML Entity Issues
**Entity: ⚠ **
- HTML Entity in code block:
if (file_exists('error_log')) {echo " ⚠" ;}
- HTML Entity inline:
if (file_exists('error_log')) {echo " ⚠" ;}
**Entity: ⚠ **`
- HTML Entity in code block:
if (file_exists('error_log')) {echo " ⚠" ;}
- HTML Entity inline:
if (file_exists('error_log')) {echo " ⚠" ;}
Image before saving (entities)
Image after saving (entities)
Image on first edit (browser view)
Image during first edit (content.md)
Image after second save (browser view)
Image after second save (content.md)
After the first edit (second save), WikiDocs converts HTML entities into their corresponding symbols (emojis) inside code blocks and inline code.
4. Textarea Issue
Image before saving (textarea)
Image after saving (browser view)
Image after saving (content.md)
Image first edit (browser view)
Image after first edit save
After the first edit (second save), WikiDocs removes everything after
textarea.
- This error occasionally occurs with HTML
hrefs as well.
Conclusion
Based on my analysis:
- The backslash error (
\→\textbackslash) was introduced in version 65 (XSS implementation). - All other errors existed before version 64.
I tested with EasyMDE 2.20.0, but the issues persisted.
I’ll try to replicate the issue in WikiDocs v1, but since my programming knowledge is limited, I might not find the root cause. However, code inside blocks or inline should never be modified by the system.
I suppose the The content is modified due to:
- Sanitization
htmlspecialchars()- Multiple HTML entity processing
- Parser issues
- XSS protection
Screenshots (optional)
No response
Extra fields
- [ ] I'd like to work on this issue