From 7746d98a0f2d268ea96587bb64d9d43f0aee705b Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 27 Mar 2019 11:41:58 -0700 Subject: [PATCH] why is blockquote not cooperating --- quad/qtest/fark.rkt | 21 ++++++++++----------- quad/qtest/markdown.rkt | 12 ++++++------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/quad/qtest/fark.rkt b/quad/qtest/fark.rkt index 044eaa1b..a4ee9963 100644 --- a/quad/qtest/fark.rkt +++ b/quad/qtest/fark.rkt @@ -1,18 +1,17 @@ #lang qtest/markdown +> So why did his sister not go and join the others? She had probably +only just got up and had not even begun to get dressed. And why was +she crying? Was it because he had not got up, and had not let the +chief clerk in, because he was in danger of losing his job and if +that happened his boss would once more pursue their parents with the +same demands as before? + + So why did his sister not go and join the others? She had probably only just got up and had not even begun to get dressed. And why was she crying? Was it because he had not got up, and had not let the chief clerk in, because he was in danger of losing his job and if that happened his boss would once more pursue their parents with the -same demands as before? There was no need to worry about things like -that yet. Gregor was still there and had not the slightest -intention of abandoning his family. For the time being he just lay -there on the carpet, and no-one who knew the condition he was in -would seriously have expected him to let the chief clerk in. It was -only a minor discourtesy, and a suitable excuse could easily be -found for it later on, it was not something for which Gregor could -be sacked on the spot. And it seemed to Gregor much more sensible -to leave him now in peace instead of disturbing him with talking at -him and crying. But the others didn't know what was happening, they -were worried, that would excuse their behaviour. +same demands as before? + diff --git a/quad/qtest/markdown.rkt b/quad/qtest/markdown.rkt index 5e012d8d..d7b959e2 100644 --- a/quad/qtest/markdown.rkt +++ b/quad/qtest/markdown.rkt @@ -277,16 +277,16 @@ (require sugar/list) (define (fill-wrap qs ending-q) - (match-define (list line-width line-height) (quad-size q:line)) - ;; todo: how to detect last line of paragraph? - (match (and ending-q (pair? qs) (quad-ref (car qs) 'line-align #f)) + (match (and ending-q (not (para-break? ending-q)) (pair? qs) (quad-ref (car qs) 'line-align #f)) ["justify" - ;; words may still be in hyphenated fragments - ;; (though soft hyphens would have been removed) (define word-sublists (filter-split qs (λ (q) (equal? (car (quad-elems q)) " ")))) (match (length word-sublists) [1 qs] ; can't justify single word [word-count + (match-define (list line-width line-height) (quad-size q:line)) + ;; words may still be in hyphenated fragments + ;; (though soft hyphens would have been removed) + ;; so group them (but no need to consolidate — that happens elsewhere) (define words-width (for*/sum ([word-sublist (in-list word-sublists)] [word (in-list word-sublist)]) (pt-x (size word)))) @@ -636,7 +636,7 @@ (define strs (match (list . STRS) [(? null?) '(" ")] [strs strs])) - (define qx (list* 'q null (add-between strs pbr))) + (define qx (list* 'q null (append (add-between strs pbr) (list pbr)))) (run qx PDF-PATH))])) (module+ reader