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

Quote​HTML

by mutian ALL

Quote HTML snippet as a string.

Labels javascript, js, php, html, quote

Details

  • 2017.09.10.11.25.32
  • github.​com
  • github.​com
  • 7 years ago
  • 49 minutes ago
  • 10 years ago

Installs

  • Total 7K
  • Win 5K
  • Mac 1K
  • Linux 491
Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14
Windows 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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!