#Auto Line breaks in Raw Text

7 messages · Page 1 of 1 (latest)

vestal peak
#

Hi, I'm trying to display the encrypted message from Edgar Poe's Gold Bug, which has no spaces, turned out line breaks are automatically inserted at some semi-colons.
I'm wondering if there is a way to display it normally, I mean, like in the way code editors do, natural wrapping at the width of the page.
Any suggestions are welcome and appreciated. Thank you!
`
#set page(paper: "a6", margin: 3em)

53‡‡†305))6*;4826)4‡.)4‡);806*;48†8¶60))85;1‡(;:‡*8†83(88)5*†;46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8*;4069285);)6†8)4‡‡;1(‡9;48081;8:8‡1;48†85;4)485†528806*81(‡9;48;(88;4(‡?34;48)4‡;161;:188;‡?;

`

slim comet
#

Did you already found a solution?

spring swallow
#

?r ```ansi
#import sym: zws

#show raw: it=> {
// show ";": ";" + zws
show regex("."): ch=> ch + zws

it

}

/* when copying, remove and retype these --> /53‡‡†305))6*;4826)4‡.)4‡);806*;48†8¶60))85;1‡(;:‡*8†83(88)5*†;46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8*;4069285);)6†8)4‡‡;1(‡9;48081;8:8‡1;48†85;4)485†528806*81(‡9;48;(88;4(‡?34;48)4‡;161;:188;‡?;/ <-- when copying, remove and retype these */

thorny timber
#

hmm, as far as I can tell, copying this out of the PDF then contains all these space characters...

daring fjord
#

maybe this:

#
#show raw.where(lang: "encrypted"): it => {
  let w = measure("x").width
  let clusters = it.text.clusters()
  layout(size => {
    let chunk-size = calc.floor(size.width / w)
    for chunk in clusters.chunks(chunk-size) {
      chunk.sum()
      linebreak()
    }
  })
}

// put here raw block with "encrypted" language tag