Enter superscript in textfield - blackberry-10

How can I enter a superscript in a text-field in blackberry cascades. I am making a small maths apps and need to enter some text in superscript(variables power)? If this is not possible can you suggest some possible workaround. I am using these in a list too, so I would prefer if rich text is not used.

You can use HTML text styling (including CSS) for certain widgets with text ie Label, TextField etc. Not sure if there's a tag for superscript since tags support is quite limited, but it's worth to have a look at available ones:
http://developer.blackberry.com/cascades/documentation/ui/text/styles.html (scroll down to HTML text styling section)

Related

What's the easiest way to escape HTML rich text syntax in Unity?

Unity texts have that feature where certain HTML-style tags can be used to format text, like <b></b> for bold and <color=#ff0000></color> for colored text. Sometimes I see some Unity games display user-provided text (like a nickname or a chat message) and they are not escaped, which means the formatting tags get applied if the user types in those tags. Asking for those devs (I don't dev myself), what's the best/easiest way to escape those tags? Are there built-in functions for that, or should they write/import a new function?
Edit: Yes I did look up "C# HTML escaping" and found a function that escapes < into <, but Unity doesn't render < as < and I got <color=#ff0000> nonsense in the Unity scene. Yes I do realize there is a tick box that disables rich text but there is also a use case where, for example, you actually want to use user-provided text within a rich text context.
Both Text and TMP_Text (TextMeshPro and TextMeshProUGui) have according field Rich Text in the Inspector or via code it is Text.supportRichtText and TMP_Text.richText. By default they come enabled.
Yes I do realize there is a tick box that disables rich text but there is also a use case where, for example, you actually want to use user-provided text within a rich text context.
So quite simple
Enable this option in use cases where you want to allow that rich text tags change the format
Disable this option if you do not want it.
As said you can even switch this on runtime via code when needed.
If you want to further prevent your users from being able to putting certain symbols into input fields at all use the according input type and input validation settings (see e.g. InputField)

How to write text on right of an image using GitHub markdown

I want to write text on the right side of an image in GitHub .md file. I mean image should be displayed on the left side of the text (text including heading, list, para and links). I know I can do it using HTML or CSS using flex or so but is it possible to do it using GitHub markdown? And is it also possible for the text to be vertically aligned with respect to image size?
Markdown doesn't provide a set of rules or syntax for how the text is to be displayed, other than allowing HTML elements with CSS. That's because Markdown, like HTML, is a markup language, and presentation is supposed to be done outside of it at a separate level (usually CSS).
However, for a variety of reasons, including security, aesthetics, and accessibility, GitHub strips out all CSS when it's rendering HTML from a README or other text document, so there isn't a way to do what you want.
Unfortunately the accepted answer is wrong. It is possible.
Github-Markdown:
<img align="left" width="200" src="https://www.rd.com/wp-content/uploads/2018/02/25_Hilarious-Photos-that-Will-Get-You-Through-the-Week_280228817_Doty911.jpg" />
# Headline
Some text
Rendered result on Github:
For the sake of completeness:
See also this answer: GitHub Pages: How can I wrap text around an image?

Creating a Rich Text Editor in Flutter

I am planning to create a rich text editor in Flutter for a personal application. I know there are already some options like zefyr. However, it is still in dev preview and I want to build something a bit different.
The features of the text editor will be that users can add images, bolden text, add lists, italicize text, etc. Just basic text editor things.
Where I am having issues is in the text input side of things. The flutter default text input only allows one style of text per text field. So that would pose a great challenge when it comes to inline styling. Also, a text field cannot have an image inside it, so that is another problem.
If anyone has any ideas on how to go about this, it will be great for a start.
So, I am really asking for the approach to create the editor because it is not as simple as creating one in html

How to use Rich Text Editor in AEM web page

I am creating a form, and in that I need to input some text and I want to use Rich Text editor in it.
When that page is published, then the user must be able to enter the text using that rich text format, i.e. Bold, italics, bullet number list etc .
How can i use the AEM rich text editor in it. I know I can include any other free editor available in the market.
I like to know that how can I use the rich text editor which is used in dialog by AEM?
You need to use a existing richtext editor in front end side like a field in the form. For example: wysihtml5

Gwt, how to make "Rich Text Area" to accept only a few features such as Bold Italic & remove all others?

Let say, when u create a new post in stackoverflow, then u can only set old, & some very simple Html tags.
The "Rich Text Area" in Gwt has too many features that I don't need. i just need Bold, italic, Underline & hyperlink. So How to customize the "Rich Text Area" so that it only accepts some limioted of features.
Also, when user put any formatted text from internet into the "Rich Text Area", it will clear all the formats but keep Bold, italic, Underline & Hyperlink.
The other solution is to make Text Area to work like RichText Area??
So, do u have any idea how to do it?
There isn't a method where you can go richTextAreaToolbar.setActiveBlagh(false), which honestly would be amazing.
Since GWT uses a default RichTextToolbar, you need a custom RichTextToolbar.
Code
Use the code from there, but remove all the unnecessary functionality like color/images/etc.
You could even add your own if you so wish.
It will take a while, but being able to customize your own widgets is so much more satisfying.
EDIT:
Here is another link to give you advice on how to set it all up: Custom RichTextToolbar