3

I like to improve readability and managing some HTML source code like this

<iframe src= "https://www.google.com/recaptcha/api2/anchor?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL                                   &co=aHR0cDovL3BsYXkuc3BvdGlmeS5jb20                                 &hl=de&v=r20160802154045&theme=dark&size=normal&cb=ap65yyq41qhy" title="reCAPTCHA-Widget" ...

I mean line breaking attribut names is the first step:

<iframe src= "https://www.google.com/recaptcha/api2/anchor?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL                                   &co=aHR0cDovL3BsYXkuc3BvdGlmeS5jb20                                 &hl=de&v=r20160802154045&theme=dark&size=normal&cb=ap65yyq41qhy"
        title="reCAPTCHA-Widget" 

However is there a way of breaking down that long URL that i'll look somehow like this:

   "https://www.google.com/recaptcha/api2/anchor" +
        "?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL" +
        "&co=aHR0cDovL3BsYXkuc3BvdGlmeS5jb20" +
...
        "&size=normal" +
        "&cb=ap65yyq41qhy"
Nadu
  • 2,401
  • 1
  • 25
  • 30

1 Answers1

4

That's it:

<iframe 
 src = "
  https://www.google.com/recaptcha/api2/anchor
   ? k = 6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL
   & co = aHR0cDovL3BsYXkuc3BvdGlmeS5jb20
   & hl = de
   & v = r20160802154045
   & theme = dark
   & size = normal
   & cb = ap65yyq41qhy
  "
 ></iframe>

Well the secret ingredient here is to use solidly tab's instead of space when you are inside some string! The parser will filter them out and you get some working url.

Nadu
  • 2,401
  • 1
  • 25
  • 30
  • What if I have a text that is too long such as the Base64 encoded text of an image? I am trying to use it in Visual Studio and tabbing would take a long time. – user2063329 Aug 11 '21 at 04:02
  • Hmm doing that manually is tedious. Be clever use tools or create one yourself! Here's some example how to do it with a regular expression: https://regex101.com/r/bLu2QZ/1 In Python ya may do it like this: import re result = re.sub(r"(.{80})", "\\t\\1\\n", "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABI...") So create a small script that'll read/write into the clipboard ( in py 'import win32clipboard') link it to a shortcut to perform the trick with a click. – Nadu Aug 20 '21 at 23:36