Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

claat: support for sub-level lists #9

Open
x1ddos opened this issue Jun 7, 2016 · 4 comments
Open

claat: support for sub-level lists #9

x1ddos opened this issue Jun 7, 2016 · 4 comments
Labels
feature request Category label for feature requests

Comments

@x1ddos
Copy link
Contributor

x1ddos commented Jun 7, 2016

For instance, this:

  • one
    • one-one
    • one-two
  • two

gets flattened into this:

  • one
  • one-one
  • one-two
  • two

/cc @JoseAlcerreca

@x1ddos x1ddos self-assigned this Jun 7, 2016
@x1ddos x1ddos added the bug label Jun 7, 2016
@x1ddos x1ddos added enhancement and removed bug labels Oct 5, 2016
@x1ddos
Copy link
Contributor Author

x1ddos commented Oct 5, 2016

FTR: turned out this is how export in HTML works in Google Docs, not a bug in claat.

@x1ddos x1ddos removed their assignment Jul 21, 2019
@craigbox
Copy link

CLaaT gets its HTML by constructing a URL of the form https://docs.google.com/document/d/0x12345DEADBEEF/export?mimeType=text/html. Nested lists aren't really nested in Docs, they're just at different (adjustable) indents. Thus, for

  • This
    • Example
  • List

we get HTML in the form

<ul class="c2 lst-kix_kf9tpzu7r2bh-0 start">
	<li class="c1"><span class="c0">This</span></li>
</ul>
<ul class="c2 lst-kix_kf9tpzu7r2bh-1 start">
	<li class="c4"><span class="c0">Example</span></li>
</ul>
<ul class="c2 lst-kix_kf9tpzu7r2bh-0">
	<li class="c1"><span class="c0">List</span></li>
</ul>

The list-kix classes refer to the bullet used, and the c1 and c4 classes refer to the indent. From the embedded CSS:

 .lst-kix_kf9tpzu7r2bh-0>li:before { content: "\0025cf "; }  # BLACK CIRCLE
 .lst-kix_kf9tpzu7r2bh-1>li:before { content: "\0025cb "; }  # WHITE CIRCLE
 .c1 { margin-left: 36pt; }
 .c4 { margin-left: 72pt; }

Thus the simplest fix I can think of would be to:

  • parse the CSS classes for each <li>
  • if any of them contain a margin-left, copy the margin-left to a style attribute on that entity

@oshliaer
Copy link

Is there a chance to hope for a level by the last character of the class name?

  • lvl 0
    • lvl 1
      • lvl 2
      • lvl 2
        • lvl 3
        • lvl 3
      • lvl 2
      • lvl 2
    • lvl 1
    • lvl 1
  • lvl 0
    • lvl 1
    • lvl 1
  • lvl 0
    • lvl 1
    • lvl 1
    <ul class="c1 lst-kix_u006isz69p4w-0 start">
      <li class="c4"><span class="c0">lvl 0</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-1 start">
      <li class="c3"><span class="c0">lvl 1</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-2 start">
      <li class="c5"><span class="c0">lvl 2</span></li>
      <li class="c5"><span class="c0">lvl 2</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-3 start">
      <li class="c7"><span class="c0">lvl 3</span></li>
      <li class="c7"><span class="c0">lvl 3</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-2">
      <li class="c5"><span class="c0">lvl 2</span></li>
      <li class="c5"><span class="c0">lvl 2</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-1">
      <li class="c3"><span class="c0">lvl 1</span></li>
      <li class="c3"><span class="c0">lvl 1</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-0">
      <li class="c4"><span class="c0">lvl 0</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-1 start">
      <li class="c3"><span class="c0">lvl 1</span></li>
      <li class="c3"><span class="c0">lvl 1</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-0">
      <li class="c4"><span class="c0">lvl 0</span></li>
    </ul>
    <ul class="c1 lst-kix_u006isz69p4w-1 start">
      <li class="c3"><span class="c0">lvl 1</span></li>
      <li class="c3"><span class="c0">lvl 1</span></li>
    </ul>

1584943802835
1584943731430

@cassierecher cassierecher added feature request Category label for feature requests and removed enhancement labels Aug 4, 2020
@mukeshgurpude
Copy link

@cassierecher any update on this??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Category label for feature requests
Projects
None yet
Development

No branches or pull requests

5 participants