Report any technical problems you discover and discuss solutions.

Code being automatically replaced

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
9 jaren 8 maanden geleden - 9 jaren 8 maanden geleden #4110 door Neil Pollock
Code being automatically replaced werd gestart door 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 >?
Laatst bewerkt 9 jaren 8 maanden geleden door Neil Pollock.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
9 jaren 8 maanden geleden #4111 door Neil Pollock
Beantwoord door Neil Pollock in topic 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>

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 8 maanden geleden #4114 door Fay
Beantwoord door Fay in topic 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)
De volgende gebruiker (s) zei dank u: Neil Pollock

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
9 jaren 8 maanden geleden #4116 door Neil Pollock
Beantwoord door Neil Pollock in topic 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).

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ronmjultenJohnSmith
Tijd voor maken pagina: 0.138 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo