ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* More spurious <break/> problems in exports
@ 2018-07-18  2:59 Rik Kabel
  2018-07-18 11:11 ` Hans Hagen
  2018-07-18 14:56 ` Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Rik Kabel @ 2018-07-18  2:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2122 bytes --]

List,

Another oddity with <break/> elements in XML / xhtml / html export:

With a defined highlight, a break is inserted if the highlight is the 
first item in an environment. If it is not the first item in the 
environment, no break is inserted.

Most of the other odd breaks can be dealt with in css. These are more 
difficult to tame -- for example, in the startlines environment in the 
example below, there is not enough information preserved to know if the 
tagged item is supposed to be a single line or not.

(Tests using 2018-07-17 beta on Win64.)

Has anyone dealt with this before? Is there a way to control the 
insertion of the breaks?

MWE:

    \setupbackend     [export=yes]
    \definehighlight  [emIt]
                       [style=italic]
    \starttext
    \startparagraph
       {\emIt Taa} aaaaaaaaaaa aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa
       aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.
    \stopparagraph
    \startparagraph
       Taa {\emIt aaaaaaaaaaa} aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa
       aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.
    \stopparagraph
    \startlines
       {\emIt Xyz} abcdefg
       Xyz {\emIt abcdefg}
    \stoplines
    \stoptext

XML output snip:

    <document context="2018.07.17 17:25" date="2018-07-17T22:41:25+20:00" file="xxx" language="en" version="0.35" xmlns:m="http://www.w3.org/1998/Math/MathML">
      <metadata>
      </metadata>
      <paragraph><highlight detail="emIt">Taa</highlight>  <break/>
    aaaaaaaaaaa aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.</paragraph>
      <paragraph>Taa <highlight detail="emIt">aaaaaaaaaaa</highlight> aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.</paragraph>
      <lines detail="lines" chain="lines">
       <line><highlight detail="emIt">Xyz</highlight>   <break/>
    abcdefg</line>
       <line>Xyz <highlight detail="emIt">abcdefg</highlight></line>
      </lines>
    </document>

Rendered in Firefox:

-- 
Rik


[-- Attachment #1.2.1: Type: text/html, Size: 2823 bytes --]

[-- Attachment #1.2.2: bmcemfjjfnpmhihd.png --]
[-- Type: image/png, Size: 12264 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: More spurious <break/> problems in exports
  2018-07-18  2:59 More spurious <break/> problems in exports Rik Kabel
@ 2018-07-18 11:11 ` Hans Hagen
  2018-07-18 14:56 ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2018-07-18 11:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Rik Kabel

On 7/18/2018 4:59 AM, Rik Kabel wrote:
> List,
> 
> Another oddity with <break/> elements in XML / xhtml / html export:
> 
> With a defined highlight, a break is inserted if the highlight is the 
> first item in an environment. If it is not the first item in the 
> environment, no break is inserted.
> 
> Most of the other odd breaks can be dealt with in css. These are more 
> difficult to tame -- for example, in the startlines environment in the 
> example below, there is not enough information preserved to know if the 
> tagged item is supposed to be a single line or not.
> 
> (Tests using 2018-07-17 beta on Win64.)
> 
> Has anyone dealt with this before? Is there a way to control the 
> insertion of the breaks?
> 
> MWE:
> 
>     \setupbackend     [export=yes]
>     \definehighlight  [emIt]
>                        [style=italic]
>     \starttext
>     \startparagraph
>        {\emIt Taa} aaaaaaaaaaa aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa
>        aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.

\emIt{Taa}

>     \stopparagraph
>     \startparagraph
>        Taa {\emIt aaaaaaaaaaa} aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa
>        aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.
>     \stopparagraph
>     \startlines
>        {\emIt Xyz} abcdefg
>        Xyz {\emIt abcdefg}
>     \stoplines
>     \stoptext
> 
> XML output snip:
> 
>     <document context="2018.07.17 17:25" date="2018-07-17T22:41:25+20:00" file="xxx" language="en" version="0.35" xmlns:m="http://www.w3.org/1998/Math/MathML">
>       <metadata>
>       </metadata>
>       <paragraph><highlight detail="emIt">Taa</highlight>  <break/>
>     aaaaaaaaaaa aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.</paragraph>
>       <paragraph>Taa <highlight detail="emIt">aaaaaaaaaaa</highlight> aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.</paragraph>
>       <lines detail="lines" chain="lines">
>        <line><highlight detail="emIt">Xyz</highlight>   <break/>
>     abcdefg</line>
>        <line>Xyz <highlight detail="emIt">abcdefg</highlight></line>
>       </lines>
>     </document>
> 
> Rendered in Firefox:
> 
> -- 
> Rik
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: More spurious <break/> problems in exports
  2018-07-18  2:59 More spurious <break/> problems in exports Rik Kabel
  2018-07-18 11:11 ` Hans Hagen
@ 2018-07-18 14:56 ` Hans Hagen
  2018-07-18 16:05   ` Rik Kabel
  1 sibling, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2018-07-18 14:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Rik Kabel

On 7/18/2018 4:59 AM, Rik Kabel wrote:
> List,
> 
> Another oddity with <break/> elements in XML / xhtml / html export:
> 
> With a defined highlight, a break is inserted if the highlight is the 
> first item in an environment. If it is not the first item in the 
> environment, no break is inserted.
> 
> Most of the other odd breaks can be dealt with in css. These are more 
> difficult to tame -- for example, in the startlines environment in the 
> example below, there is not enough information preserved to know if the 
> tagged item is supposed to be a single line or not.
> 
> (Tests using 2018-07-17 beta on Win64.)

You get this, with the numbers representing the paragraph number:

\starttext
% foo

\startparagraph
   \emIt{x 1} a 1
\stopparagraph

\startparagraph
   {\emIt x 2} a unset
\stopparagraph

\stoptext

of this:

\starttext
foo 1

\startparagraph
   \emIt{x 2} a 2
\stopparagraph

\startparagraph
   {\emIt x 3} a 1
\stopparagraph

\stoptext

so, when the par number is effectively set inside a group you end up 
with bad tags which will force that break because it's a different 
paragraph .. no way to intercept or chaneg that

The best I can do is issue a warning like

export > fuzzy paragraph: a (U+00061) [space] - (U+0002D) 2 (U+00032) 1 
(U+00031) 4 (U+00034) 7 (U+00037) 4 (U+00034) 8 (U+00038) 3 (U+00033) 6 
(U+00036) 4 (U+00034) 7 (U+00037)
backend         > x

so that one can fix the source.

> Has anyone dealt with this before? Is there a way to control the 
> insertion of the breaks?
> 
> MWE:
> 
>     \setupbackend     [export=yes]
>     \definehighlight  [emIt]
>                        [style=italic]
>     \starttext
>     \startparagraph
>        {\emIt Taa} aaaaaaaaaaa aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa
>        aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.
>     \stopparagraph
>     \startparagraph
>        Taa {\emIt aaaaaaaaaaa} aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa
>        aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.
>     \stopparagraph
>     \startlines
>        {\emIt Xyz} abcdefg
>        Xyz {\emIt abcdefg}
>     \stoplines
>     \stoptext
> 
> XML output snip:
> 
>     <document context="2018.07.17 17:25" date="2018-07-17T22:41:25+20:00" file="xxx" language="en" version="0.35" xmlns:m="http://www.w3.org/1998/Math/MathML">
>       <metadata>
>       </metadata>
>       <paragraph><highlight detail="emIt">Taa</highlight>  <break/>
>     aaaaaaaaaaa aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.</paragraph>
>       <paragraph>Taa <highlight detail="emIt">aaaaaaaaaaa</highlight> aa aaaaaaaaa aaaaaa aaa aaaaaaaa aa aaaaaaaaaa aaaaaa. Taa aaaaaaaa aaaaa, aaaaa aaaaaaaa aa aaaaa aaaa aaaaa.</paragraph>
>       <lines detail="lines" chain="lines">
>        <line><highlight detail="emIt">Xyz</highlight>   <break/>
>     abcdefg</line>
>        <line>Xyz <highlight detail="emIt">abcdefg</highlight></line>
>       </lines>
>     </document>
> 
> Rendered in Firefox:
> 
> -- 
> Rik
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: More spurious <break/> problems in exports
  2018-07-18 14:56 ` Hans Hagen
@ 2018-07-18 16:05   ` Rik Kabel
  0 siblings, 0 replies; 4+ messages in thread
From: Rik Kabel @ 2018-07-18 16:05 UTC (permalink / raw)
  To: Hans Hagen, mailing list for ConTeXt users

On 7/18/2018 10:56, Hans Hagen wrote:
> On 7/18/2018 4:59 AM, Rik Kabel wrote:
>> List,
>>
>> Another oddity with <break/> elements in XML / xhtml / html export:
>>
>> With a defined highlight, a break is inserted if the highlight is the 
>> first item in an environment. If it is not the first item in the 
>> environment, no break is inserted.
>>
>> Most of the other odd breaks can be dealt with in css. These are more 
>> difficult to tame -- for example, in the startlines environment in 
>> the example below, there is not enough information preserved to know 
>> if the tagged item is supposed to be a single line or not.
>>
>> (Tests using 2018-07-17 beta on Win64.)
>
> You get this, with the numbers representing the paragraph number:
>
> \starttext
> % foo
>
> \startparagraph
>   \emIt{x 1} a 1
> \stopparagraph
>
> \startparagraph
>   {\emIt x 2} a unset
> \stopparagraph
>
> \stoptext
>
> of this:
>
> \starttext
> foo 1
>
> \startparagraph
>   \emIt{x 2} a 2
> \stopparagraph
>
> \startparagraph
>   {\emIt x 3} a 1
> \stopparagraph
>
> \stoptext
>
> so, when the par number is effectively set inside a group you end up 
> with bad tags which will force that break because it's a different 
> paragraph .. no way to intercept or chaneg that
>
> The best I can do is issue a warning like
>
> export > fuzzy paragraph: a (U+00061) [space] - (U+0002D) 2 (U+00032) 
> 1 (U+00031) 4 (U+00034) 7 (U+00037) 4 (U+00034) 8 (U+00038) 3 
> (U+00033) 6 (U+00036) 4 (U+00034) 7 (U+00037)
> backend         > x
>
> so that one can fix the source.

Changing from a font switch ­– {\emIt text} – to a command – \emit{text} 
– resolves the issue for these cases. I will add a note to the wiki 
that, when changing from font switches to highlighting, one should 
change the syntax.

-- 
Rik
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-18 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18  2:59 More spurious <break/> problems in exports Rik Kabel
2018-07-18 11:11 ` Hans Hagen
2018-07-18 14:56 ` Hans Hagen
2018-07-18 16:05   ` Rik Kabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).