Flex s:text htmltext missing out/cutting the full html text - apache-flex

I am trying to implement htmlText for a text component as the returned string is in html format (with the html tags etc). If I put a text=.... i get the full text, but with the tags (which i want converted to html). So i use htmlText=.... and it formats it fine, but cuts half the text from the variable. The text im supposed to get back has tons of html tags, and maybe its cutting it somewhere because of the tag its not able to escape... How do i fix this? Any solutions?

Not all tags are supported in the htmlText property. Here's a list of the tags that can be handled :
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#htmlText
An example though would make debugging easier :)

Related

unable to find the reference to the content property in a stylesheet

Firstly let me admit that I am a beginner in CSS. I recently came across a nice website: http://www.sitepoint.com/better-solution-managing-z-index-sass/ and was curious to know how the "3" is displayed alongside "CSS". When I tried to check through the firebug, I saw a class name ".category-css .icon-category:before" which contains content property which has some strange content.
Could you please let me know where is content property pointing to. I know this might be the silliest question, but I am clueless.
On the <i class="icon-category> they are setting a font-family: 'sitepoint', Sans-Serif;, on the :before element the content element is using a Unicode, which will relate to a character from their custom font 'sitepoint'.
For example, Font Awesome uses unicodes for it's characters, as you can see each character has a unique code next to it.

content property in CSS

In some template I see that an arrow that created with CSS. something like this:
div:after{
content:"\f107";
}
this code display an arrow like this :
what is this code? where I can find more codes?
Using content property embeds a virtual content inside an element, it is used with a pseudo :before or :after, so if you use :before, the content will be embedded before.
From MDN :
The content CSS property is used with the ::before and ::after
pseudo-elements to generate content in an element. Objects inserted
using the content property are anonymous replaced elements.
Content property can hold any character, number, entities. For more information, you can refer an article here.
Also, you can get an handy converter here.
This method is also used by font-awesome - Example and other related svg font embedding libraries, where you can simply call classes to the elements and the fonts will be embedded virtually.
Also, just a side information, content generated using CSS content property is inline by default, also this is rendered inside the element and not outside..
It's an escaped unicode character.
As other answers have explained, the CSS rule uses the content property to insert a character by its Unicode number.
However, the character used is U+F107 PRIVATE USE CHARACTER-F107. This means that it has no meaning except by private agreements and should not be used in public information interchange. Unfortunately, some “awesome” tricks use Private Use code points to insert graphic symbols. This means that unless a very specific font, with some symbols assigned to those code points is used, a generic symbol of an unknown character appears.
So it is much safer to use an image instead, in the content proper.
CSS has a property called content. It can only be used with the pseudo elements :after and :before. It is written like a pseudo selector (with the colon), but it's called a pseudo element because it's not actually selecting anything that exists on the page but adding something new to the page.
Font Awesome is a web font containing all the icons from the Twitter Bootstrap framework, and now many more.
You can find a list of FontAwesome here : A list of Font Awesome icons and their CSS content values
You can also go through this link, FontAwesome Examples, where you can see different icons and how to apply different size on it.
CSS Content Property : The content property is used with the :before and :after pseudo-elements, to insert generated content.
Read more

Insert script via CSS content property

Is it possible to insert script tag using content property of CSS?
The example below inserts plain text instead of a html tag
#someDiv:before {
content:"<script>$(function(){ console.log('test');});</script>";
}
Content inserted with the content property will only ever be plain text. This is to prevent recursion. It also helps by preventing people from doing crazy things like inserting script elements with CSS.

ASP.NET DataBoundField DataFormatString, how can I add html correctly?

I have a DataboundField in a grid. I'm trying to display a date in Euro format and the time. The time should be wrapped in a span with a css class applied to it.
I am using this, DataFormatString="{0:dd/MM/yyyy <\span cla\s\s='tinyDate'>hh:mm:ss</\span>}"
It's actually pretty close, except the span tag is literally rendering in the browser.
In the cell the text looks like this
19/10/2010 <span class=tinyDate>09:35:00</span>
I don't intend to see the span tag, only it's formatted content. How can I remedy this and make it render correctly?
Thanks for any tips or links.
Cheers,
~ck in San Diego
Try setting the HtmlEncode property of the field to "false". It's enabled by default to prevent any malicious client-script code from being executed.

Locating tag by its text using css

How would you get the following tag using CSS?
<p>You can only use the text inside the tag</p>
As in xpath I'd use the following:
//p[contains(text(), "inside the tag")
PS: I can't close the xpath, it tries to auto complete with code... :S
I believe CSS3 selectors can only filter attributes, not the text within tags. So you could do something like a[href~="aspx"] to match links to aspx pages, but that's as far as content-based matching can go.
For what you want to do, you'll probably have to use javascript or server-side processing.
Have a look at quirksmode and W3 for more information.
This is what I was looking for!
p:contains("inside the tag")

Resources