Comments (4)
FTR: turned out this is how export in HTML works in Google Docs, not a bug in claat.
from tools.
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.
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 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>
from tools.
@cassierecher any update on this??
from tools.
Related Issues (20)
- Chrome
- CONTRIBUTING.md
- Digital Creator
- Continously publish `latest` release binaries
- Address Spam Issues and Pull Requests (ideally with an automated Bot) HOT 3
- Publish Codelab/s for Codelab Tools
- ERROR: .../WORKSPACE:...: name 'maven_server' / 'maven_jar' / ... is not defined
- Metadata at start of Markdown should be in standard YAML Front Matter (at least optionally)
- claat watch
- site: npm install: SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? HOT 1
- 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
- skycory13kam
- [email protected]
- Help me to secure my account
- Code
- Substitution of https://groups.google.com/g/codelab-authors HOT 1
- Codelab
- quan_lecture_R
- Hello
- Projeto liliti stk 3.6.9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tools.