Expand my Community achievements bar.

SOLVED

Sightly: getting special characters in element attribute

Avatar

Level 3

Java output:

title = title - !  # $ % &  !#$%&()*+,-./:;<=?@[]^_{|}~

<title> ${properties.title @ context = 'unsafe'} </title>

Output:  <title>title - !  # $ % &  !#$%&()*+,-./:;<=?@[]^_{|}~</title>

Where as <meta name="title" content="${properties.title @ context = 'unsafe'}">

Output: <meta name="title" content content="title - ! # $ % &amp; !#$%&amp;()*+,-./:;&lt;=?@[]^_{|}~">

I tried context = text as well

<meta name="title" content="${properties.title @ context = 'text'}">

Output: <meta name="title" content content="title - ! # $ % &amp; !#$%&amp;()*+,-./:;&lt;=?@[]^_{|}~">

For example how can I get "<"  inside the tags instead of &lt;

title124 special characters ! # $ % & !#$%&()*+,-./:;<=?@[]^_{|}~

title124 special characters ! # $ % & !#$%&()*+,-./:;<=?@[]^_{|}~

title124 special characters ! # $ % & !#$%&()*+,-./:;<=?@[]^_{|}~

1 Accepted Solution

Avatar

Correct answer by
Employee

This is invalid HTML...

View solution in original post

6 Replies

Avatar

Employee

Will this not result in invalid HTML, when you have < in an attribute?

Avatar

Employee

What output do you want? Can you specify the HTML-attribute value you want?

Avatar

Level 3

Expected HTML Attribute Value:  <meta name="title" content="title - !  # $ % &  !#$%&()*+,-./:;<=?@[]^_{|}~">

Avatar

Correct answer by
Employee

This is invalid HTML...