Giter Site home page Giter Site logo

Comments (4)

x1ddos avatar x1ddos commented on July 20, 2024

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

from tools.

craigbox avatar craigbox commented on July 20, 2024

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

from tools.

oshliaer avatar oshliaer commented on July 20, 2024

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

from tools.

mukeshgurpude avatar mukeshgurpude commented on July 20, 2024

@cassierecher any update on this??

from tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.