I would like display, in a textbox, the spaces and the carriage return in order to show the user the exact test formatting, ie using a central point for spaces and an arrow for CRLF. Any idea ?
Eah, it's really hard! But you can replace spaces with some printable symblos for display purposes only. But carriage you shouldn't replace, just add new Symbols.
And before text usage, before writing to file for example, just convert all symbols back to spaces.
This solutiond of course, is not universal and complete.
Related
Below is a picture of my current accessibility tree. You can see that the 4 text leaves in it are separated, but it still forms only one line of content. Is this still accessible well ("well" meaning screen readers can detect that they form one complete sentence), or should all of the text leaves be combined into one leaf?
If they should be combined, how can you concatenate variables into the text in React, while keeping it as one single leaf? This is my current code: <p>{cloudiness}% ({cloudinessDescription})</p>
How they are read aloud depends on the screen reader being used. VoiceOver reads it as one phrase, but that doesn't mean others will. Having it split up wouldn't be a nice experience, but it doesn't mean it's not accessible.
If you really want to make sure it's read as one phrase but don't like the noise of the template literal inside the JSX (I agree), why not define the string somewhere else until you are able to test on multiple screen readers?
const cloudinessSummary = `${cloudiness}% (${cloudinessDescription})`;
return <p>{cloudinessSummary}</p>;
I'm trying to edit code (C++/C#/Java) in a RichTextBox of a winfrom application.
Since there are different new line breakers in different platform, I'm using these code to encode the rich text:
value = value
.Replace("\r\n", "\\par ")
.Replace("\r", "\\par ")
.Replace("\n", "\\par ");
All the 3 types of newline breakers are displayed fine. But then I noticed that, since \r\n(2 chars in file content) has been encoded as \par (1 char in RichTextBox.Text), the index of a certain text differs. Thus RichTextBox.Select(index, length) will select text in the wrong position, if the position was calculated from the raw file content. For each more line, the difference of index increases 1.
I'm thinking if there is anything like "\\return\\par", which is counted as 2 chars but displayed as 1 newline breaker; and in RichTextBox.Text(it will be saved as the file content), it is decoded back as "\r\n".
And if not, is there any other way to align index of file content and RichTextBox.Text? Thanks.
BTW I have a dirty way to walk around: RichTextBox.Select(index - lineNo, length). But it's really ugly.
Using libedit/editline, and trying to figure out a good way to do multiline input/editing. The target is an SQL client, where queries will often span multiple lines and terminate with ;.
I can call el_gets, and process each line of input, stopping when I see the terminating ;. I can even concatenate those and store them as a single entry in el_history - and it will correctly access them when using the arrows to scroll through history.
However, when entering the command and after starting a new line, I can no longer use the arrows to move up and edit the previous line. E.g.:
prompt> SELECT * FROM table
WHERE 🀫
At that point, I'd like to be able to use the up-arrow, to move up and edit the text already entered on the first line. Is this possible? How would one do so? I assume that using el_gets isn't correct in this case, since it would remove the line from the editline buffering, yet I don't see an alternative API that would work.
Thoughts?
extJS didnt see too big text with many <\br>'s..
If i write text something like "lalal lalalal lsadsdhas afjhjhj";
Its okei, works.
If i write text with \n (<\br>) something like:
"hello,
my name
is Polly!";
ExtJS didnt see those lines. How i can avoid this?
Thank you!
This is because Javascript doesn't allow multi-line strings. If you want a linebreak in your string, it has to be coded with an escape sequence like '\r\n'. So,
alert("hello, \r\nmy name\r\nis Polly!");
will display as 3 lines. If the string is going into an html element, then insert '<br />' in place of the '\r\n'.
finally, if you need a long string with lots of blank spaces between the words, for some reason, you can either keep typing on the same line, or break it up into several lines and combine the lines with the '+' operator, like this:
var longstring =
'hello \r\n'
+'my name \r\n'
+'is Polly!';
I've got a FlowDocument generating a document for a client, and it's getting a line break that they don't like. Is there any way to mark a section of text that it should avoid line breaks? Something like this:
<Paragraph>Here is a paragraph where there should be <span NoLineBreak=True>no line break</span> in a certain part.</Paragraph>
Obviously, a Span doesn't have a NoLineBreak property, but I'm wondering if there's some equivilant functionality available, or if someone can get me started on a way of implementing a SpanWithNoLineBreak class or RunWithNoLineBreak class?
UPDATE
Actually, one issue I'm having is with a percent sign, where there isn't even a space:
<Paragraph>When I print and ½% I want the one-half and '%' symbols to not line break between them.</Paragraph>
The & #x00BD; is the unicode for a ½ symbol. I'm getting a line wrap between the 1/2 and the % even though there's no space between them.
The Unicode character "Word Joiner" (U+2060) is intended for just this purpose. It "does not normally produce any space but prohibits a line break on either side of it" (Wikipedia). You place it between U+00BD and '%' to prevent a line break between them.
Unfortunately, WPF (or perhaps the typical fonts supplied with Windows) don't support it properly, and instead render it as a square box. As an alternative, you could use U+FEFF; the use of this character as a zero-width non-breaking space is now deprecated (it's reserved for use as a byte-order mark), but it worked as a line-break-preventer for me.
Finally, there are some other characters that can also be used for this purpose: U+202F (narrow no-break space) also prevents breaking, but also renders as a very thin space. U+00A0 (no-break space) prevents breaking and displays as a normal space.
Try replacing the spaces with non-breaking spaces.
EDIT: Well there's always the backup plan of just putting in TextBlocks in your FlowDocument with TextWrapping=NoWrap, but I'd try to find a better way...