Brown-University-Library / OLD-ARCHIVED_iip-production

3 stars 9 forks source link

transcription and diplomatic divs with empty elements as contents don't display content #55

Closed emylonas closed 4 years ago

emylonas commented 4 years ago

For ex: in .https://dlibwwwcit.services.brown.edu/iip/viewinscr/masa0295/ The contents of the transcription are:

<div type="edition" subtype="transcription" ana="b1" xml:lang="heb">
           <p>
               <g type="phoen-YOD"/><g type="phoen-NUN"/>
            </p>
</div>

the display shows [no transcription]

This is generated from one of the following files (found by grepping recursively for "no transcription"

./static/mapsearch/js/result_display.js:                $(domTarget).find(".transcription").append("<tei-div>[no transcription]</tei-div>");

./static/mapsearch/js/result_display.js:                $(domTarget).find(".transcription").html("[no transcription]");

./static/iip_search_app/js/result_display.js:                $(domTarget).find(".transcription").append("<tei-div>[no transcription]</tei-div>");

./static/iip_search_app/js/result_display.js:                $(domTarget).find(".transcription").html("[no transcription]");
./templates/iip_search_templates/results.html:                                    [no transcription]

Apparently the code is testing for a <div> element with no text() or spaces in it. However, the <g> elements generate content - they are standing in for non-displayable elements. In other cases, where there is a non-space text node, the <g> elements show up, because all content is pulled from the source file. See https://dlibwwwcit.services.brown.edu/iip/viewinscr/masa0301/ This is probably true for diplomatic divs as well.

emylonas commented 4 years ago

@birkin masa0940c.xml has no transcription. It does have a diplomatic component.

            <div type="edition" subtype="diplomatic" ana="b1">
                <p>h<gap reason="lost" unit="character" extent="unknown"/></p>
            </div>
            <div type="edition" subtype="transcription" ana="b1">
                <p> </p>
            </div>

We shouldn't have any at that have no text at all.

birkin commented 4 years ago

fixed in commit https://github.com/Brown-University-Library/iip-production/commit/a09bac46dc793824ceab9b3a2aa85fba4287ae65#diff-9d7bb3eed8f06d586707c11aa8a40e06R98-R112