Report any technical problems you discover and discuss solutions.

Code being automatically replaced

  • Neil Pollock
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 9 months ago - 9 years 9 months ago #4110 by Neil Pollock
Code being automatically replaced was created by 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 >?
Last edit: 9 years 9 months ago by Neil Pollock.

Please Log in or Create an account to join the conversation.

  • Neil Pollock
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 9 months ago #4111 by Neil Pollock
Replied by Neil Pollock on 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>

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #4114 by Fay
Replied by Fay on 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)
The following user(s) said Thank You: Neil Pollock

Please Log in or Create an account to join the conversation.

  • Neil Pollock
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 9 months ago #4116 by Neil Pollock
Replied by Neil Pollock on 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).

Please Log in or Create an account to join the conversation.

Moderators: ronmjultenJohnSmith
Time to create page: 0.146 seconds
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo