blakearchive / transcription-test

0 stars 1 forks source link

spacing is off #3

Open ba001 opened 7 years ago

ba001 commented 7 years ago

@queryluke luke, i'm struggling to fix a spacing issue in the transcription viewer.

have a look at the transcription here: http://www.blakearchive.org/copy/jerusalem.e?descId=jerusalem.e.illbk.77

put the XML below into the transcription test and notice the difference. lines are overlapping and the spacing of the first two lines, as one example, is off.

is there an easy fix here? unfortunately, our assistants at rochester can't work without the transcription tester.

<phystext><texthead justify="left"><l n="jerusalem.e.illbk.77.01" justify="right"><physnumber type="pen-and-ink">77</physnumber><space extent="5"/></l></texthead><vspace extent="1"/><texthead justify="left"><l n="jerusalem.e.illbk.77.02" justify="left" indent="30">To the Christians.</l></texthead><vspace extent="1"/><columns><column><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.03" justify="left">Devils are</l></lg><vspace extent="1"/><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.04" justify="left">False Religions</l><l n="jerusalem.e.illbk.77.05" justify="left" indent="5">"Saul Saul"</l><l n="jerusalem.e.illbk.77.06" justify="left">"Why persecutest thou me,<note>A double quotation mark may be inscribed above the word "me".</note></l></lg></column><column><vspace extent="1"/><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.07" justify="left">I give you the end of a golden string,</l><l n="jerusalem.e.illbk.77.08" justify="left" indent="3">Only wind it into a ball:</l><l n="jerusalem.e.illbk.77.09" justify="left">It will lead you in at Heavens gate,</l><l n="jerusalem.e.illbk.77.10" justify="left" indent="3">Built in Jerusalems wall.</l></lg></column><column/></columns><vspace extent="1"/><lg type="prose" justify="left"><l n="jerusalem.e.illbk.77.11" justify="left" indent="1">We are told to abstain from fleshly desires 
that we may lose no time from the</l><l n="jerusalem.e.illbk.77.12" justify="left">Work of the Lord. Every moment lost, is a moment that 
cannot be redeemed </l><l n="jerusalem.e.illbk.77.13" justify="left">every pleasure that intermingles with the duty of our 
station is a folly unre-</l><l n="jerusalem.e.illbk.77.14" justify="left">-deemable &amp; is planted like the seed of a wild flower 
among our wheat. All</l><l n="jerusalem.e.illbk.77.15" justify="left">the tortures of repentance. are tortures of self-reproach on account of our lea-</l><l n="jerusalem.e.illbk.77.16" justify="left">ving the Divine Harvest to the Enemy, the struggles of 
intanglement with in-</l><l n="jerusalem.e.illbk.77.17" justify="left">coherent roots. I know of no other Christianity and of 
no other Gospel than </l><l n="jerusalem.e.illbk.18" justify="left">the liberty both of body &amp; mind to exercise the Divine 
Arts of Imagination </l><l n="jerusalem.e.illbk.77.19" justify="left">Imagination the real &amp; eternal World of which this 
Vegetable Universe is </l><l n="jerusalem.e.illbk.77.20" justify="left">but a faint shadow &amp; in which we shall live in our 
Eternal or Imaginative </l><l n="jerusalem.e.illbk.77.21" justify="left">Bodies, when these Vegetable Mortal Bodies are no 
more. The Apostles knew </l><l n="jerusalem.e.illbk.77.22" justify="left">of no other Gospel. What were all their spiritual 
gifts? What is the Divine </l><l n="jerusalem.e.illbk.77.23" justify="left">Spirit? is the Holy Ghost any other than an 
Intellectual Fountain? What is </l><l n="jerusalem.e.illbk.77.24" justify="left">the Harvest of the Gospel &amp; its Labours? What is that 
Talent which it is a </l><l n="jerusalem.e.illbk.77.25" justify="left">curse to hide? What are the Treasures of Heaven which 
we are to lay up for </l><l n="jerusalem.e.illbk.77.26" justify="left">ourselves, are they any other than Mental Studies &amp; 
Performances? What </l><l n="jerusalem.e.illbk.77.27" justify="left">are all the Gifts of the Gospel. are they not all 
Mental Gifts? Is God a </l><l n="jerusalem.e.illbk.77.28" justify="left">Spirit who must be worshipped in Spirit &amp; in Truth and 
are not the Gifts </l><l n="jerusalem.e.illbk.77.29" justify="left">of the Spirit Every-thing to Man? O ye Religious 
discountenance every </l><l n="jerusalem.e.illbk.77.30" justify="left">one among you who shall pretend to despise Art &amp; 
Science! I call upon </l><l n="jerusalem.e.illbk.77.31" justify="left">you in the Name of Jesus! What is the Life of Man but 
Art &amp; Science? </l><l n="jerusalem.e.illbk.77.32" justify="left">is it Meat &amp; Drink? is not the Body more than Raiment? What is Mortality </l><l n="jerusalem.e.illbk.77.33" justify="left">but the things relating to the Body, which Dies? What 
is Immortality but the </l><l n="jerusalem.e.illbk.77.34" justify="left">things relating to the Spirit, which Lives Eternally! 
What is the Joy of Hea-</l><l n="jerusalem.e.illbk.77.35" justify="left">-ven but Improvement in the things of the Spirit? What 
are the Pains of Hell </l><l n="jerusalem.e.illbk.77.36" justify="left">but Ignorance, Bodily Lust, Idleness &amp; devastation of 
the things of the Spirit </l><l n="jerusalem.e.illbk.77.37" justify="left">Answer this to yourselves, &amp; expel from among you 
those who pretend to des-</l><l n="jerusalem.e.illbk.77.38" justify="left">-pise the labours of Art &amp; Science, which alone are 
the labours of the Gos-</l><l n="jerusalem.e.illbk.77.39" justify="left">-pel: Is not this plain &amp; manifest to the thought? Can 
you think at all, &amp; </l><l n="jerusalem.e.illbk.77.40" justify="left">not pronounce heartily! That to Labour in Knowledge. 
is to Build up Jerusa-</l><l n="jerusalem.e.illbk.77.41" justify="left">-lem: and to Despise Knowledge, is to Despise 
Jerusalem &amp; her Builders. </l><l n="jerusalem.e.illbk.77.42" justify="left">And remember: He who despises &amp; mocks a Mental Gift in 
another; calling </l><l n="jerusalem.e.illbk.77.43" justify="left">it pride &amp; selfishness &amp; sin; mocks Jesus the giver of 
every Mental Gift.</l><l n="jerusalem.e.illbk.77.44" justify="left">which always appear to the ignorance-loving Hypocrite, 
as Sins. but that </l><l n="jerusalem.e.illbk.77.45" justify="left">which is a Sin in the sight of cruel Man. is not so in 
the sight of our kind God. </l><l n="jerusalem.e.illbk.77.46" justify="left">Let every Christian as much as in him lies engage 
himself openly &amp; publicly </l><l n="jerusalem.e.illbk.77.47" justify="left">before all the World in some Mental pursuit for the 
Building up of Jerusalem</l></lg><vspace extent="1"/><columns><column><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.48" justify="left" indent="2">I stood among my valleys of the south </l><l n="jerusalem.e.illbk.77.49" justify="left">And saw a flame of fire, even as a Wheel </l><l n="jerusalem.e.illbk.77.50" justify="left">Of fire surrounding all the heavens: it went</l><l n="jerusalem.e.illbk.77.51" justify="left">From west to east against the current of </l><l n="jerusalem.e.illbk.77.52" justify="left">Creation, and devourd all things in its loud </l><l n="jerusalem.e.illbk.77.53" justify="left">Fury &amp; thundering course round heaven &amp; earth</l><l n="jerusalem.e.illbk.77.54" justify="left">By it the Sun was rolld into an orb:</l><l n="jerusalem.e.illbk.77.55" justify="left">By it the Moon faded into a globe. </l><l n="jerusalem.e.illbk.77.56" justify="left">Travelling thro the night: for from its dire</l><l n="jerusalem.e.illbk.77.57" justify="left">And restless fury, Man himself shrunk up </l><l n="jerusalem.e.illbk.77.58" justify="left">Into a little root a fathom long.</l><l n="jerusalem.e.illbk.77.59" justify="left">And I asked a Watcher &amp; a Holy-One</l><l n="jerusalem.e.illbk.77.60" justify="left">Its Name? he answerd. It is the Wheel of Religion</l><l n="jerusalem.e.illbk.77.61" justify="left">I wept &amp; said. Is this the law of Jesus</l><l n="jerusalem.e.illbk.77.62" justify="left">This terrible devouring sword turning every way</l><l n="jerusalem.e.illbk.77.63" justify="left">He answerd; Jesus died because he strove</l><l n="jerusalem.e.illbk.77.64" justify="left">Against the current of this Wheel: its Name </l><l n="jerusalem.e.illbk.77.65" justify="left">Is Caiaphas, the dark Preacher of Death</l></lg></column><column><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.66" justify="left">Of sin, of sorrow, &amp; of punishment;</l><l n="jerusalem.e.illbk.77.67" justify="left">Opposing Nature!  It is Natural Religion<note>The "u"
in "Nature" has an additional stroke, like a "w".</note></l><l n="jerusalem.e.illbk.77.68" justify="left">But Jesus is the bright Preacher of Life</l><l n="jerusalem.e.illbk.77.69" justify="left">Creating Nature from this fiery Law,</l><l n="jerusalem.e.illbk.77.70" justify="left">By self-denial &amp; forgiveness of Sin:</l><l n="jerusalem.e.illbk.77.71" justify="left">Go therefore, cast out devils in Christs name</l><l n="jerusalem.e.illbk.77.72" justify="left">Heal thou the sick of spiritual disease</l><l n="jerusalem.e.illbk.77.73" justify="left">Pity the evil. for thou art not sent</l><l n="jerusalem.e.illbk.77.74" justify="left">To smite with terror &amp; with punishments</l><l n="jerusalem.e.illbk.77.75" justify="left">Those that are sick. like to the Pharisees</l><l n="jerusalem.e.illbk.77.76" justify="left">Crucifying &amp; encompasing sea &amp; land<note>"encompasing": i.e., "encompassing".</note></l><l n="jerusalem.e.illbk.77.77" justify="left">For proselytes to tyranny &amp; wrath.</l><l n="jerusalem.e.illbk.77.78" justify="left">But to the Publicans &amp; Harlots go!</l><l n="jerusalem.e.illbk.77.79" justify="left">Teach them True Happiness. but let no curse</l><l n="jerusalem.e.illbk.77.80" justify="left">Go forth out of thy mouth to blight their peace</l><l n="jerusalem.e.illbk.77.81" justify="left">For Hell is opend to Heaven; thine eyes beheld</l><l n="jerusalem.e.illbk.77.82" justify="left">The dungeons burst &amp; the Prisoners set free.</l></lg></column></columns><vspace extent="1"/><columns><column><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.83" justify="left">England! awake! awake! awake!</l><l n="jerusalem.e.illbk.77.84" justify="left" indent="1">Jerusalem thy Sister calls!</l><l n="jerusalem.e.illbk.77.85" justify="left">Why wilt thou sleep the sleep of death?</l><l n="jerusalem.e.illbk.77.86" justify="left" indent="1">And close her from thy ancient walls.</l></lg></column><column><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.87" justify="left">Thy hills &amp; valleys felt her feet.</l><l n="jerusalem.e.illbk.77.88" justify="left" indent="3">Gently upon their bosoms move:</l><l n="jerusalem.e.illbk.77.89" justify="left">Thy gates beheld sweet Zions ways;</l><l n="jerusalem.e.illbk.77.90" justify="left" indent="3">Then was a time of joy and love</l></lg></column></columns><lg type="verse" justify="left"><l n="jerusalem.e.illbk.77.XX" justify="left"><note>Four white-line fragments deleted from the plate (left and right of the final stanza) have been recovered from posthumous Copies by Bentley and Erdman.  Bentley reads, very tentatively (Bentley page 590n):<lb/> The Real Selfhood / is[?] in[?] J . . .[?] / a[?] vision[?] / Divine Man<lb/> Erdman reads, somewhat differently (Erdman page 233; see also page 812n):<lb/> The Real Selfhood / in the / is the ?Imagination / Divine ?Man</note></l><l n="jerusalem.e.illbk.77.91" justify="left" indent="25">And now the time returns again:</l><l n="jerusalem.e.illbk.77.92" justify="left" indent="27">Our souls exult &amp; Londons 
towers</l><l n="jerusalem.e.illbk.77.93" justify="left" indent="25">Recieve the Lamb of God to dwell</l><l n="jerusalem.e.illbk.77.94" justify="left" indent="27">In Englands green &amp; pleasant 
bowers.</l></lg></phystext>
queryluke commented 7 years ago

I'll take a look

queryluke commented 7 years ago

I'll walk you through my debugging steps:

  1. One possibility was that the CSS files for the archive had changed, but weren't updated here. I fixed that by pointing the css links at www.blackarchive.org, this will make sure you always get the production css

  2. Another possibility was that the xsl files had changed (which they had), so I updated those from the master branch of archive. This didn't fix the problem.

  3. I used dev tools to compare the computed css values and found nothing.

  4. I copied the html tei content from a working blake archive page, and put it on this page. It rendered correctly. So it wasn't the css.

  5. I threw that html in a file, then copied the output of this page into a file and ran a diff on the 2 and found the problem.

if you look at index.html (of the master branch), you'll see {{ xml|safe }}. xml is the the string it gets back after the tei transform. |safe means to render the return as html. But flask (the python library running the site) seems to have a bug. The "safe" output was adding additional </div> tags. So everything is fine in the transform, it's when python renders the transform as html. In the archive, the transform is stored and angular renders it (which is why there isn't an error)

I did a brief google search, but didn't find anything useful. I know very little about python and flask, I threw this app together mainly copying code nathan had written.

The only hack I could come up with is using javascript to replace &gt; with > and &lt; with <. I also saw &nbsp; was getting rendered as &amp;#160;.

This is not an ideal solution but that's all the time I can spend on this. You might come across other special characters that need to be replaced as well. The tiny js script is at the bottom of the index.html file.

Or perhaps there is an all python solution out there.