Thread: Quick Question
View Single Post
Old 10-30-2020, 05:49 AM   #13
un_pogaz
Chalut o/
un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.
 
un_pogaz's Avatar
 
Posts: 452
Karma: 678910
Join Date: Dec 2017
Device: Kobo
In the case of ePub editing, the block collapse system is useless (really handy to browse a big XML with a complex hierarchy system)
Nevertheless, highlighting the open/close tag of an element would be a nice addition. Advanced hierarchies are rare, but a little help is welcome.

Case study, which I really got:
Spoiler:
Code:
<body class="content">
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <div class="element-number-block">
          </div>
          <div class="heading-image-block">
            <div class="heading-image-size-container">
              <img src="../images/00003.jpeg" alt="" class="heading-image-image" data-amznremoved="mobi7"/>
              <img height="120" alt="" class="heading-image-image1" src="../images/00002.jpeg" width="129" data-amznremoved-m8="true"/>
            </div>
            <h1 class="title" id="calibre_pb_0">Chapitre 5</h1>
          </div>
          <h2 class="subtitle" id="calibre_pb_1">Kai</h2>
        </div>
      </div>
    </div>
    <div class="title-page-contributor-primary-block" id="unnumbered-5-text">
      <p class="pcalibre first1">corp texte</p>
      ...

Originally, I had to merge several HTML pages because each tag <h1> had caused a separation into individual pages.
Spoiler:
Page 1
Spoiler:

Code:
<body class="content">
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <div class="element-number-block">
          </div>
          <div class="heading-image-block">
            <div class="heading-image-size-container">
              <img src="../images/00003.jpeg" alt="" class="heading-image-image" data-amznremoved="mobi7"/>
              <img height="120" alt="" class="heading-image-image1" src="../images/00002.jpeg" width="129" data-amznremoved-m8="true"/>
</div>
</div>
</div>
</div>
 </div>
</div>
</body>


Page 2
Spoiler:

Code:
<body class="content">
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <div class="heading-image-block">
            <h1 class="title" id="calibre_pb_0">Chapitre 5</h1>
</div>
</div>
</div>
</div>
</div>
</body>


Page 2
Spoiler:

Code:
<body class="content">
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <h2 class="subtitle" id="calibre_pb_1">Kai</h2>
        </div>
      </div>
    </div>
    <div class="title-page-contributor-primary-block" id="unnumbered-5-text">
      <p class="pcalibre first1">corp texte</p>
      ...


After merging and before cleaning
Spoiler:

Code:
<body class="content">
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <div class="element-number-block">
          </div>
          <div class="heading-image-block">
            <div class="heading-image-size-container">
              <img src="../images/00003.jpeg" alt="" class="heading-image-image" data-amznremoved="mobi7"/>
              <img height="120" alt="" class="heading-image-image1" src="../images/00002.jpeg" width="129" data-amznremoved-m8="true"/>
</div>
</div>
</div>
</div>
</div>
</div>
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <div class="heading-image-block">
            <h1 class="title" id="calibre_pb_0">Chapitre 5</h1>
</div>
</div>
</div>
</div>
</div>
  <div id="unnumbered-5" class="title-page-contributor-primary-block" role="doc-chapter" epub:type="chapter">
    <div class="heading" id="unnumbered-5-heading">
      <div class="heading-contents">
        <div class="title-page-contributor-primary-block">
          <h2 class="subtitle" id="calibre_pb_1">Kai</h2>
</div>
</div>
</div>
    <div class="title-page-contributor-primary-block" id="unnumbered-5-text">
      <p class="pcalibre first1">corp texte</p>
      ...


Well, a bit of REGEX, that's what it does. But it would have helped me a lot.

EDIT: Another practical case is to find the end of an inline element in a large block of text :
Spoiler:

Quote:
Lorem ipsum <i>dolor sit amet, <b>consectetuer adipiscing elit. Duis sem velit</b>, ultrices et, fermentum auctor, rhoncus ut, ligula. Phasellus at purus sed purus cursus iaculis. Suspendisse fermentum. Pellentesque et arcu. Maecenas viverra. In consectetuer, lorem eu lobortis egestas, velit odio imperdiet eros, sit amet sagittis nunc mi ac neque. Sed non ipsum. Nullam venenatis gravida orci</i>. Curabitur nunc ante, ullamcorper vel, auctor a, aliquam at, tortor. <i>Etiam sodales orci nec ligula. Sed at turpis vitae velit euismod aliquet. Fusce venenatis ligula in pede. Pellentesque viverra dolor non nunc. Donec interdum vestibulum libero. Morbi volutpat. Phasellus hendrerit. Quisque dictum quam vel neque. Quisque aliquam, nulla ac scelerisque convallis, nisi ligula sagittis risus, at nonummy arcu urna pulvinar nibh. Nam pharetra.</i>

Last edited by un_pogaz; 10-30-2020 at 06:41 AM.
un_pogaz is online now   Reply With Quote