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 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 #888

Open
131706dulce opened this issue Dec 12, 2023 · 0 comments

Comments

@131706dulce
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

Originally posted by @craigbox in #9 (comment)

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

No branches or pull requests

1 participant