piroor / copy-selected-tabs-to-clipboard

Provides ability to copy title and URL of selected tabs to the clipboard for Firefox 63 and later.
Other
80 stars 16 forks source link

Support generating nested HTML list from tree of tabs #56

Open piroor opened 2 hours ago

piroor commented 2 hours ago

Short description

Currently there is no way to generate nested HTML list. See also: https://github.com/piroor/treestyletab/discussions/3618

Steps to reproduce

  1. Start Firefox with clean profile.
  2. Install this addon.
  3. Add rule to generate HTML list.
  4. Prepare a nested tree of tabs.
  5. Select them and copy it as an HTML list.

Expected result

A nested list is copied as:

<ul>
  <li><a href="..."></a>
    <ul>
      <li><a href="..."></a>
        <ul>
          <li><a href="..."></a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

Actual result

A flat list is copied as:

<ul>
<li><a href="..."></a></li>
<li><a href="..."></a></li>
<li><a href="..."></a></li>
</ul>

Environment

piroor commented 2 hours ago

An idea of the syntax to support such nested lists:

%RT%%PREFIX(<ul>%EOL%)%%SUFFIX(</ul>%EOL%)%<li><a href="%URL_HTMLIFIED%">%TITLE_HTMLIFIED%</a>%CHILDREN%</li>%EOL%

%EOL%%CHILDREN% will be added to the end of the definition automatically if the rule does not contain %CHILDREN%.