namiwang / wiki-flutter

more than an elegant wikipedia client
51 stars 18 forks source link

handle inline icon images #37

Open namiwang opened 7 years ago

namiwang commented 7 years ago

typically, this kind of images occur:

namiwang commented 7 years ago

this is a typical ipa icon

the sign would be ipa_button, and img width = height = 11.

    <b>Denmark</b>
     (
    <span>
      <span class=\"ipa_button\"></span>
      <span class=\ "nowrap mcs-ipa\" style=\ "display: none;\">
        <span class=\"noexcerpt\">
          <span>
            <a href=\"//upload.wikimedia.org/wikipedia/commons/9/95/En-us-Denmark.ogg\" class=\"image\">
              <img src=\"//upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Speakerlink-new.svg/11px-Speakerlink-new.svg.png\" data-file-type=\"drawing\" height=\"11\" width=\"11\" srcset=\"//upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Speakerlink-new.svg/22px-Speakerlink-new.svg.png 2x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Speakerlink-new.svg/17px-Speakerlink-new.svg.png 1.5x\">
            </a>
          </span>
          <sup>
            <span class=\"IPA\" style=\"color:#00e;font:bold 80% sans-serif;padding:0 .1em\">
              <a href=\"/wiki/File:En-us-Denmark.ogg\" title=\"File:En-us-Denmark.ogg\">i</a>
            </span>
          </sup>
        </span>
        <span class=\ "IPA nopopups noexcerpt\">
          <a href=\"/wiki/Help:IPA_for_English\" title=\"Help:IPA for English\">
            /
            <span style=\"border-bottom:1px dotted\">
              <span>ˈ</span>
              <span>d</span>
              <span>ɛ</span>
              <span>n</span>
              <span>m</span>
              <span>ɑːr</span>
              <span>k</span>
            </span>
            /
          </a>
        </span>
      </span>
    </span>
    ; 
namiwang commented 7 years ago

currently ignored all inline icons, since flutter doesn't support inline Image/Icon/ImageIcon in TextSpan for now.

namiwang commented 7 years ago

rely on https://github.com/flutter/flutter/issues/2022