Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-17-2018, 04:11 AM   #1
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,056
Karma: 6000097
Join Date: Jul 2012
Device: Nook
[Issue] Pretty Printing <mark>

<mark> is a new HTML5 element used for highlighting:

https://developer.mozilla.org/en-US/...L/Element/mark
https://www.w3.org/TR/html5/textleve...e-mark-element

<mark> is mostly used in-line. For example:

Spoiler:
Code:
<p>This is an example of <mark class="match">marked text</mark>.</p>

<p>And a “quote that is <mark>important</mark>.”</p>


After Pretty Printing in Sigil, each <mark> gets extra whitespace + placed on their own lines:

Spoiler:
Code:
  <p>This is an example of 

  <mark class="match">marked text</mark>

.</p>

  <p>And a “quote that is 

  <mark>important</mark>

.”</p>


In many cases, this extra whitespace can completely botch the spacing (especially around punctuation).

The actual display before Pretty Print:

Code:
This is an example of marked text.

And a “quote that is important.”
After Pretty Print:

Code:
This is an example of marked text .

And a “quote that is important .”
For Pretty Printing, <mark> should probably be treated just like a <b> or <i> tag.

Last edited by Tex2002ans; 08-17-2018 at 05:39 AM.
Tex2002ans is offline   Reply With Quote
Old 08-17-2018, 09:46 AM   #2
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 3,073
Karma: 1931746
Join Date: Nov 2009
Device: many
I will look into it.
Thanks.
KevinH is offline   Reply With Quote
Old 08-17-2018, 11:29 AM   #3
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 3,073
Karma: 1931746
Join Date: Nov 2009
Device: many
This should now be fixed in master. And yes handling mark like other inline tags was the answer.

Thank you for your bug report with explanatory links and testcase! It made things much easier to handle.
KevinH is offline   Reply With Quote
Old 08-17-2018, 03:51 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,056
Karma: 6000097
Join Date: Jul 2012
Device: Nook
Quote:
Originally Posted by KevinH View Post
This should now be fixed in master. And yes handling mark like other inline tags was the answer.

Thank you for your bug report with explanatory links and testcase! It made things much easier to handle.


Also, this one is purely for aesthetics, but would it be possible to do a similar thing with Prettifying <td> + <th>?

Older versions of Sigil (forget which version) used to keep them "condensed":

2x6 Simple Table (Old Method):

This method was easily readable.

Note: I recreated the spacing off the top of my head. It was similar to this.

Spoiler:
Code:
  <table border="1">
    <tbody>
      <tr>
        <th colspan="2"><i>Proportion of age groups attending school</i></th>
      </tr>

      <tr>
        <th>Ages (years)</th>

        <th>Per cent attending</th>
      </tr>

      <tr>
        <td>10–14</td>

        <td>96</td>
      </tr>

      <tr>
        <td>15–17</td>

        <td>56</td>
      </tr>

      <tr>
        <td>18–20</td>

        <td>17</td>
      </tr>

      <tr>
        <td>21</td>

        <td>5</td>
      </tr>
    </tbody>
  </table>


2x6 Simple Table (New Method):

Spoiler:
Code:
  <table border="1">
    <tbody>
      <tr>
        <th colspan="2">
          <i>Proportion of age groups attending school</i>
        </th>
      </tr>

      <tr>
        <th>
          Ages (years)
        </th>

        <th>
          Per cent attending
        </th>
      </tr>

      <tr>
        <td>
          10–14
        </td>

        <td>
          96
        </td>
      </tr>

      <tr>
        <td>
          15–17
        </td>

        <td>
          56
        </td>
      </tr>

      <tr>
        <td>
          18–20
        </td>

        <td>
          17
        </td>
      </tr>

      <tr>
        <td>
          21
        </td>

        <td>
          5
        </td>
      </tr>
    </tbody>
  </table>


Even the most simple of tables explodes beyond a full screen length. And the way it is indented is much harder to figure out the values + what a table is doing just from the code.
Tex2002ans is offline   Reply With Quote
Old 08-17-2018, 04:03 PM   #5
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 3,073
Karma: 1931746
Join Date: Nov 2009
Device: many
Pretty printing tables is hard to do and not easy to change in this case. As td and tr are not inline tags and are more like block tags and are currently treated that way, ie whitespace immediately before and after is ignored. I will look into this when I get more free time but no promises, as technically what is currently done is correct and a search and replace using regular expressions should be possible to change it to what you prefer.
KevinH is offline   Reply With Quote
Old 08-18-2018, 03:52 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,674
Karma: 11766398
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
Quote:
Originally Posted by KevinH View Post
Pretty printing tables is hard to do and not easy to change in this case. As td and tr are not inline tags and are more like block tags and are currently treated that way, ie whitespace immediately before and after is ignored. I will look into this when I get more free time but no promises, as technically what is currently done is correct and a search and replace using regular expressions should be possible to change it to what you prefer.
This^^. I have a saved search that condenses a table after I am done making sure it's good. Although I condense MUCH more than what you have.

Spoiler:
Code:
<table>
<tbody>
<tr><td>Yadda</td><td>Yadda</td><td>Yadda</td></tr>
<tr><td>Yadda</td><td>Yadda</td><td>Yadda</td></tr>
<tr><td>Yadda</td><td>Yadda</td><td>Yadda</td></tr>
</tbody>
</table>


I've attached the .ini if anyone wants to import it.
Attached Thumbnails
Click image for larger version

Name:	condenseTable.JPG
Views:	30
Size:	20.9 KB
ID:	165702  
Attached Files
File Type: zip condenseTable.zip (341 Bytes, 12 views)
Turtle91 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Biography Twain, Mark: Mark Twain's Notebook. v1. 11 Mar 2013 GrannyGrump ePub Books 0 03-11-2013 02:07 AM
PRS-650 Mark all as read/Mark as unread mornington Sony Reader 7 07-05-2011 10:43 AM
Please please please pretty please... nortydog Sony Reader Dev Corner 1 01-09-2010 07:23 PM


All times are GMT -4. The time now is 12:21 PM.


MobileRead.com is a privately owned, operated and funded community.