ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Quote​HTML

by mutian ST2/ST3

Quote HTML snippet as a string.

Labels javascript, js, php, html, quote

Details

  • 2017.09.10.11.25.32
  • github.​com
  • github.​com
  • 3 months ago
  • Just now
  • 4 years ago

Installs

  • Total 5K
  • Win 4K
  • OS X 1K
  • Linux 337
Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1
Windows 0 6 1 5 6 6 1 5 3 5 5 9 12 4 1 3 3 1 6 4 1 0 4 3 2 12 9 2 1 6 2 7 5 3 2 6 3 2 1 6 4 0 4 2 2 7
OS X 1 1 1 1 2 1 0 1 3 3 2 2 1 1 1 3 2 0 0 0 1 0 2 1 0 2 0 0 0 2 1 0 0 0 2 0 1 2 1 2 1 1 2 1 0 2
Linux 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 2 0 0 1 0 1

Readme

Source
raw.​githubusercontent.​com

QuoteHTML for Sublime Text

Description

Quote HTML snippet as a string.

Example:

  • Original HTML:

    <div class="demo">
        <ol>
            <li>1</li>
            <li><a href='#'>2</a></li>
            <li><a href="#">3</a></li>
        </ol>
    </div>
    
  • Quote HTML with Single Quotes:

    '<div class="demo">' +
        '<ol>' +
            '<li>1</li>' +
            '<li><a href=\'#\'>2</a></li>' +
            '<li><a href="#">3</a></li>' +
        '</ol>' +
    '</div>';
    
  • Quote HTML with Double Quotes:

    "<div class=\"demo\">" +
        "<ol>" +
            "<li>1</li>" +
            "<li><a href='#'>2</a></li>" +
            "<li><a href=\"#\">3</a></li>" +
        "</ol>" +
    "</div>";
    
  • Quote HTML with Single Quotes include Space:

    '<div class="demo">' +
    '    <ol>' +
    '        <li>1</li>' +
    '        <li><a href=\'#\'>2</a></li>' +
    '        <li><a href="#">3</a></li>' +
    '    </ol>' +
    '</div>';
    
  • Quote HTML with Double Quotes include Space:

    "<div class=\"demo\">" +
    "    <ol>" +
    "        <li>1</li>" +
    "        <li><a href='#'>2</a></li>" +
    "        <li><a href=\"#\">3</a></li>" +
    "    </ol>" +
    "</div>";
    
  • Quote HTML as Array with Single Quotes:

    [
        '<div class="demo">',
            '<ol>',
                '<li>1</li>',
                '<li><a href=\'#\'>2</a></li>',
                '<li><a href="#">3</a></li>',
            '</ol>',
        '</div>'
    ].join("");
    
  • Quote HTML as Array with Double Quotes:

    [
        "<div class=\"demo\">",
            "<ol>",
                "<li>1</li>",
                "<li><a href='#'>2</a></li>",
                "<li><a href=\"#\">3</a></li>",
            "</ol>",
        "</div>"
    ].join("");
    
  • Quote HTML as Array with Single Quotes include Space:

    [
        '<div class="demo">',
        '    <ol>',
        '        <li>1</li>',
        '        <li><a href=\'#\'>2</a></li>',
        '        <li><a href="#">3</a></li>',
        '    </ol>',
        '</div>'
    ].join("");
    
  • Quote HTML as Array with Double Quotes include Space:

    [
        "<div class=\"demo\">",
        "    <ol>",
        "        <li>1</li>",
        "        <li><a href='#'>2</a></li>",
        "        <li><a href=\"#\">3</a></li>",
        "    </ol>",
        "</div>"
    ].join("");
    

Installation

OPTION 1 - with Package Control (recommended)

The easiest way to install this package is through Package Control.

  1. Install Package Control, follow instructions on the website.

  2. Open command panel: Ctrl+Shift+P (Linux/Windows) or Cmd+Shift+P (OS X) and select Package Control: Install Package.

  3. When packages list appears, type QuoteHTML and select it.

OPTION 2 - with Git

Clone the repository in your Sublime Text “Packages” directory:

git clone git://github.com/mutian/Sublime-Quote-HTML.git "QuoteHTML"

You can find your “Packages” inside the following directories:

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/

  • Windows: %APPDATA%/Sublime Text 2/Packages/

  • Linux: ~/.Sublime Text 2/Packages/

OPTION 3 - without Git

Download the latest source zip from Github and extract it into a new folder named QuoteHTML in your Sublime Text “Packages” folder.

Usage

Select the code, or place cursor in the document, and execute commands in one of the following ways:

  • Edit Menu: Edit > Quote HTML.

  • Command Panel: Open command panel: Ctrl+Shift+P (Linux/Windows) or Cmd+Shift+P (OS X) and select Quote HTML.

Shortcuts

By default QuoteHTML provides no keyboard shortcuts to avoid conflicts, but you can view the included Example.sublime-keymaps file to get an idea how to set up your own.

Author

Created by Mutian (http://mutian.wang).

For more info, you can send email to me: mutian(a)me.com!