Report any technical problems you discover and discuss solutions.

Code being automatically replaced

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 9 mois - il y a 9 ans 9 mois #4110 par Neil Pollock
Code being automatically replaced a été créé par Neil Pollock
I'm writing some MHRA referencing guidelines in a Bootstrap template. In this referencing style web pages should be enclosed within a set of angled brackets, for example:

Christel Lane and others, The Future of Professionalised Work: UK and Germany Compared (London: Anglo-German Foundation for the Study of Industrial Society, 2003) < www.agf.org.uk/pubs/pdfs/1232web.pdf > [accessed 12 December 2007] (p. 11)


So, I figured that this could simply be written in the Bootstrap page as:
Code:
&lt;http://www.agf.org.uk/pubs/pdfs/1232web.pdf&gt;

However, if you leave the page, then return to look at the source, you'll find it is has been changed to show:
Code:
<http://www.agf.org.uk/pubs/pdfs/1232web.pdf>

If you leave and open the source again, it shows:
Code:
<http: 1232web.pdf="" pdfs="" pubs="" www.agf.org.uk=""> </http:>

How can I stop it from changing lt and gt into < and >?
Dernière édition: il y a 9 ans 9 mois par Neil Pollock.

Connexion ou Créer un compte pour participer à la conversation.

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 9 mois #4111 par Neil Pollock
Réponse de Neil Pollock sur le sujet Code being automatically replaced
On a related note, in HTML5 you are able to wrap block-level elements with anchor tags. For example:

Code:
<a href="#"> <div class="section01"> <h1>Heading</h1> <p>Some text.</p> </div> </a>

However, Xerte doesn't appear to like this and will automatically convert such code to:
Code:
<div class="section01"> <h1><a href="#">Heading</a></h1> <p><a href="#">Some text.</a></p> </div>

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 9 mois #4114 par Fay
Réponse de Fay sur le sujet Code being automatically replaced
Hi Neil

The anchor tag issue seems to be a known issue with ckeditor that Xerte uses. You can use this workaround where you surround the div with the link at runtime:
Code:
<div id="anchorDiv" class="section01"> <h1>Heading</h1> <p>Some text.</p> </div> <script> $('#anchorDiv').wrap('<a href="#"></a>'); </script>

The < > issue also seems to be a problem with ckeditor. You can either make the url a link:
Code:
<p>Christel Lane and others, The Future of Professionalised Work: UK and Germany Compared (London: Anglo-German Foundation for the Study of Industrial Society, 2003)&nbsp;&lt;<a href="http://www.agf.org.uk/pubs/pdfs/1232web.pdf" target="_blank">www.agf.org.uk/pubs/pdfs/1232web.pdf</a>&gt;&nbsp;[accessed 12 December 2007] (p. 11) </p>

or if you'd prefer not to do this then surround the url with a span tag:
Code:
<p>Christel Lane and others, The Future of Professionalised Work: UK and Germany Compared (London: Anglo-German Foundation for the Study of Industrial Society, 2003)&nbsp;&lt;<span>www.agf.org.uk/pubs/pdfs/1232web.pdf</span>&gt;&nbsp;[accessed 12 December 2007] (p. 11)&nbsp; </p>

It seems to not like the < being directly next to the url (simply adding a space also works but I guess this isn't ideal if you're showing how the reference should be written)
Les utilisateur(s) suivant ont remercié: Neil Pollock

Connexion ou Créer un compte pour participer à la conversation.

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 9 mois #4116 par Neil Pollock
Réponse de Neil Pollock sur le sujet Code being automatically replaced
Thanks for this.

The <span> workaround seems to do the job for now (although, it still converts code to brackets if you use the "HTML Code" page type rather than the "Text" page type).

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ronmjultenJohnSmith
Temps de génération de la page : 0.142 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo