How do I copy/paste website content WITH formatting

766

Solution 1

Well, Chrome, or any modern browser, when copying your selection, will always copy the HTML (i.e., with formatting). The software you're pasting it into, however, need to support this (most office programs do, but you might need to select "Paste Special" or Ctrl+Shift+V).

Still, the browser will only copy the HTML, but not the styles associated with it, so any indirect formatting through CSS rules will most likely not be copied and, in fact, it would be very difficult to copy them.

Solution 2

Like Stefan said, any browser will copy the html, but you need to paste it into a program that will recognise it.

This is something I've been trying to do today, and there are some great wysiwyg editors you can use:

I wish there was a preview mode for these, but well, they work!

Solution 3

In Google Chrome, you can select the text (don't need to be completely precise at this step, as you will need to select again), then Inspect (or Ctrl+Shift+I), and then you have options (Copy Outer HTML,Edit as HTML) to copy the HTML code as the 'text/plain' MIME type the text editor prefers.

That might be an add-on free option if your editing environment (my case too) does not provide proper support for pasting MIME flavors other than plain text.

Share:
766

Related videos on Youtube

Simeon Leyzerzon
Author by

Simeon Leyzerzon

Updated on September 18, 2022

Comments

  • Simeon Leyzerzon
    Simeon Leyzerzon over 1 year

    I'm building an app utilizing the new Action on Google Java API. As I understand from dealing with account linking in Alexa, the initial flow (when the userId in the JSON request is null) should redirect to a sign in form to elicit user consent:

        @ForIntent("RawText")
        public ActionResponse launchRequestHandler(ActionRequest request) {
    
           String userId = request.getAppRequest().getUser().getUserId();
           String queryText = request.getWebhookRequest().getQueryResult().getQueryText();
    
           String speech = null;
    
                ResponseBuilder responseBuilder = getResponseBuilder(request);
    
                if (isBlank(userId) || GREETING.equalsIgnoreCase(queryText)) {
    
                    speech = "I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps.";
    
                    responseBuilder.add(
                        new SignIn()
                            .setContext(speech));
                    //...
                    return responseBuilder.build();
    

    While testing in the AoG Simulator, however, I'm not seeing any redirection being done. I'm seeing the following error:

    enter image description here

    My account linking setup:

    enter image description here

    where authorization URL redirects to a local mock auth service which is supposed to display a login form. It's accessible (both via localhost and via ssh tunnel, provided by serveo.net reverse proxy in this case). Why Google doesn't redirect me there?

    Can someone please guide me how to do this initial handshake in the account linking flow and where can I see the form which the Sign-In intent sent from the web hook is supposed to trigger?

    I'd rather not use my phone, as the error message seems to suggest, as the account under which I'm testing in AoG simulator differs from my user ID on the phone.

    What is meant by using Simulator as a Speaker? What is missing in my setup?

    Is there another Google app that simulates the physical device better, similar to Alexa's simulator?

  • Marcus Chan
    Marcus Chan over 11 years
    Exactly. @Volodymyr, where are you trying to paste into?
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    Trying to paste it on another tab in the same browser, to another SE site as an answer.
  • Stefan Seidel
    Stefan Seidel over 11 years
    @Volodymyr That won't ever work, since browser input fields never support formatting, only plain text (unless it's a javascript-based rich edit field, which is not the case for SE sites).
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    I see, so only manual formatting is possible, which is pretty time-consuming:(.
  • Merger
    Merger over 11 years
    Stack Exchange sites use MarkDown, so I think you should be able to edit an answer/question to access the MarkDown script and paste that into the other Stack Exchange site as an answer.
  • Nelu
    Nelu about 10 years
    The common practice on Stack Exchange is to create the demo on jsfiddle.net, jsbin.com, etc, and then add the link in your question/answer.
  • Simeon Leyzerzon
    Simeon Leyzerzon about 5 years
    Yes, I tried Simulator as a Speaker approach and get the same error. How do I use it on the phone? When I say talk to speechbank there in assistant app, it gives some irrelevant results. Do I need to somehow publish the action or am I missing something else?
  • Aytacworld
    Aytacworld about 5 years
    You have 2 options: 1) you don't publish your Action, but you need to use the same account on your phone. You can switch account in the Accounts settings on assistant app. 2) You release an alpha version of your Action and put your email(that you use on your phone) in the Alpha testers list. And wait one day, and you can test it on your device... In your alpga testers page, you need to copy the opt-in link and open it in your assistant enabled phone. And an Alpha deploy also takes one day to be deployed and testable on your phone(even if they say 3-4 hours).
  • Simeon Leyzerzon
    Simeon Leyzerzon about 5 years
    Thanks, with your suggestions, etc. we were able to figure out a set up that seems to work, however we are now faced with another challenge described here:stackoverflow.com/questions/54810597/…. Perhaps, you could give us some pointers helping to resolve that one out as well.
  • Alexxx
    Alexxx about 5 years
    I have exactly the same problem... and can't resolve it. I've tried option 1. Don't know what to do as I don't want to publish yet (as it just a test).
  • Aytacworld
    Aytacworld about 5 years
    On you phone, use the gmail account you are using to create the action. Then open your assistant app on your phone and search in the explore section to your action.(support.google.com/googlehome/answer/…) even if you didn't released it yet, it will be available to your account only.