I have been using Xinha editor for many years now in the background - and I'm still happy with it (although there are more powerful editors with more features available). However one thing which bugged me for a long time was the editing of content which contains example HTML or XML snippets.
Such an example can be found on article ILO4 Firmware 1.20 changed the XML output, where an output of an XML file is showing up:
However when this article is opened in Xinha (for example for modifying the content), the XML output disappears:
When new content is entered into the Xinha editor, typical code syntaxes (just as < and >) are entered as lt and gt characters:
This can be verified using the source code view of the editor:
This is also how the content is saved into the database.
However when Xinha loads such a content, it automatically translates < and > as "<" and ">" - they effectively become code and Xinha tries to display a (non-existing) code part.
When looking at the source code view of the mentioned article above, this can be seen nicely:
The question is now: How can Xinha be told to not translate these syntax characters into code characters?
The Xinha FAQ has one specific article: Entize your data. From this page:
When you put HTML into a textarea to be turned into a Xinha editor, many people forget that raw HTML in a textarea is not valid, this leads to all sorts of unusual symptoms.
As the content is loaded in a textarea field, the output of the content is wrapped into the PHP function htmlspecialchars():
<textarea required class="form-control" rows="50" id="iContent" name="iContent"><?php if (isset($iContent)) {echo htmlspecialchars($iContent);} ?></textarea>
Using this tells Xinha to not translate the special characters into code characters and the content (code) is preserved:
By looking at the source code view, the < and > characters are now preserved:
No comments yet.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder