Telegra.ph text formatting - telegram

It is said that http://telegra.ph is an editor that is able to format a text via HTML tags or markdown. In online editor neither the first nor the second method is working. What am I doing wrong? How to format text?

You can see API document, there support only limited tags.
You can select text on Telegraph Editor, you will see floating menu which contains formatting options.
I think you mistake Telegraph as Bot API, which provides Markdown and HTML formatting options.

Related

How does #:~:text= work for highlighting text?

When following a link from the Google search page, I often see the most relevant part of the page highlighted like so:
Looking at the URL, I see bits of the highlighted text appear after the #:~:text= anchor (hash, colon, tilde, colon, text - in case someone is trying to Google this question):
https://ru.wikipedia.org/wiki/%D0%A4%D0%B0%D0%BC%D0%B8%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D0%BF%D1%80%D0%B8%D1%81%D1%82%D0%B0%D0%B2%D0%BA%D0%B0#:~:text=%D0%BF%D0%B0%D0%BB%D0%BE%D0%BC%D0%BD%D0%B8%D1%87%D0%B5%D1%81%D1%82%D0%B2%D0%BE%20%D0%B2%20%D0%9C%D0%B5%D0%BA%D0%BA%D1%83-,%D0%90%D1%80%D0%BC%D0%B5%D0%BD%D0%B8%D1%8F,%D1%8F%D0%B2%D0%BB%D1%8F%D0%BB%D1%81%D1%8F%20%D1%81%D1%8B%D0%BD%D0%BE%D0%BC%20%D0%B8%D0%BB%D0%B8%20%D0%BF%D0%BE%D1%82%D0%BE%D0%BC%D0%BA%D0%BE%D0%BC%20%D1%81%D0%B2%D1%8F%D1%89%D0%B5%D0%BD%D0%BD%D0%B8%D0%BA%D0%B0
Is this notation (#:~:text=) Wikipedia-specific or is it a more standard way of highlighting text on a web page? Where can I read up on this? So far my google-fu has failed me.

Keep text format when copy/paste from Angular Application

I've realized that when I try to copy/paste a text from an Angular Application to any text editor software (ie Microsoft Word), all the text loses the original format.
I'm using as example the angular material website: https://material.angular.io/
When I copy the text and past in Microsoft Word:
Thats means, the pasted text lost the center alignment, the color and de font type.
Is there a way to keep the website format? I know that the font used by Angular Material is different from text editor, but there are another things that could be mantained (i.e. alignment, color, etc).
I've started a project using Angular 8 + Angular Material and I'm facing the same problem.
Well, you're not likely to get a straight copy/paste action to do what you're requesting.
Why it doesn't work as you expect:
Copy & Paste out of MS Word for example and you'll get Rich Text where all the formatting is part of the data payload. When you copy this to the clipboard all that extra styling metadata goes along with the text. If you paste that data INTO a rich text editor (not a straight text input) like Wordpress's Admin that editor package translates the text metadata that you can't see into equivalent HTML styling.
However, When you copy from HTML (in your browsers) all you're getting is the text without all the "rich" formatting. This happens because a browser uses outside context like DOM position, tag type, and CSS to style the HTML content into what is presented for you to see.
Rich text copy for just YOU
There are multiple browser plug-ins for Chrome and Firefox that will intercept your copy request, create formatting and then paste that to the clipboard. Just ask Google for recommendations.
Rich text copy for all users of a project
This, unfortunately, is more complicated. You will need to write code to do the following (this answer has a good example):
Figure out what the user is trying to copy (usually mapped to selected text).
Convert that content into rich text format. The example above simply copies the HTML but that won't get styling applied by external CSS. Packages like Quill MIGHT give you the option to get rich text back out.
Copy your converted text to the user's local clipboard. You shouldn't hijack browser commands to do this which is why you frequently see a "copy to clipboard" button to do this action. You can move content to the user's clipboard using the Clipboard API in most modern browsers.
Oh and you'll need the user's permission to do all this since proactively interacting with the user's clipboard presents a pretty massive security issue.

Formatting text boxes in Google forms

I am using Google forms "Get Pre-filled linked" and fill out some text boxes automatically. Here is an example text-box filled out with with "pre-filled link":
Is there a way to format the text inside the textbox? For example:
- Have new lines in the text box.
- Make some parts of it bold.
An example desired output with new lines (which I have added manually; not sure how make parts of text bold):
Thoughts on how to format text for Google forms?
I was looking for the same functionality and all I can find on the google forums is "it doesn't support that."
My workaround is this: Create the formatted text in a google doc then take a screen grab with the Snippet tool (or SnagIt or whatever your favorite screen grabber is).
Save the image to your drive then add it to the form.
This seems like a ridiculous thing to have to do, but it does work.

org-protocol formatting selected text

When you capture through org-protocol and a browser, either through the capture(); function or encodeURIComponent(window.getSelection());, the text appears to be passed to the Emacs org-protocol server as plain text.
Is there a way to pull in some of the HTML heading/CSS style info to keep a minimal amount of formatting for readability? Most sites aren't anything close to plain text, so even selecting across a heading and a couple paragraphs comes out like garbage.
edit: I found pandoc, which will do HTML to org-mode conversions, but the results are overkill. Is there any way to get just the formatting from the selected objects, not a blind parse of HTML chunk?

Formatting text in Crystal Reports

I need users to be able to enter text in a webform with some basic formatting options and then generate a report showing the formatted text.
The support for HTML is horrible and entering a simple bulletlist doesn't even show properly in the report.
Right now i'm using a textarea with tinyMCE but that's because i don't know what else to use.
Is there a known best-practice for showing formatted text in a Crystal Report?
Edit
I just need to show a report with a bunch of text and icons. Users need to be able to save it to PDF. I doesn't even have to be Crystal Reports but it's what i have been using and worked so far. Until i needed to show formatted text.
I wish for another solution that comes with a designer and let's me bind against a DataSet.
The solution is to convert the HTML to RTF. RTF support in CR is much better than it is for HTML. This way users can still use the tinyMCE editor and even paste Word formatted HTML.
The way i convert the HTML to RTF if using an XSL stylesheet. Basically you load the HTML as an XML document and let the XSL translate it to RTF. This way you also have a lot of freedom over the way your text will appear since you can tweak the XSL.
I used this article to achieve that, the article's attachment includes the .XSL.

Resources