From a43aa1bc79b99321e8569e644008907d5841e334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 18 Jun 2020 00:25:15 +0200 Subject: [PATCH] texinfo: Add basic support for @w{...}. * module/texinfo.scm (texi-command-specs): Add 'w'. (space-significant?): Add it. * module/texinfo/html.scm (tag-replacements): Add 'w'. * test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add test. --- module/texinfo.scm | 5 +++-- module/texinfo/html.scm | 3 ++- test-suite/tests/texinfo.test | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/texinfo.scm b/module/texinfo.scm index f3af5c332..ff95f182d 100644 --- a/module/texinfo.scm +++ b/module/texinfo.scm @@ -1,6 +1,6 @@ ;;;; (texinfo) -- parsing of texinfo into SXML ;;;; -;;;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2020 Free Software Foundation, Inc. ;;;; Copyright (C) 2004, 2009 Andy Wingo ;;;; Copyright (C) 2001,2002 Oleg Kiselyov ;;;; @@ -211,6 +211,7 @@ lambda. Only present for @code{INLINE-ARGS}, @code{EOL-ARGS}, (sansserif INLINE-TEXT) (slanted INLINE-TEXT) (t INLINE-TEXT) + (w INLINE-TEXT) ;; Inline args commands (value INLINE-ARGS . (key)) @@ -382,7 +383,7 @@ Examples: ;; The % is for arguments (define (space-significant? command) (memq command - '(example smallexample verbatim lisp smalllisp menu %))) + '(example smallexample verbatim lisp smalllisp menu w %))) ;; Like a DTD for texinfo (define (command-spec command) diff --git a/module/texinfo/html.scm b/module/texinfo/html.scm index d505d7f12..6d139ddeb 100644 --- a/module/texinfo/html.scm +++ b/module/texinfo/html.scm @@ -1,6 +1,6 @@ ;;;; (texinfo html) -- translating stexinfo into shtml ;;;; -;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2011, 2020 Free Software Foundation, Inc. ;;;; Copyright (C) 2003,2004,2009 Andy Wingo ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -202,6 +202,7 @@ name, @code{#}, and the node name." (*fragment* div) ;; should be ok (asis span) + (w span (@ (class "verbatim"))) (bold b) (i i) (sample samp) diff --git a/test-suite/tests/texinfo.test b/test-suite/tests/texinfo.test index 6f7d4c7d8..416fd286c 100644 --- a/test-suite/tests/texinfo.test +++ b/test-suite/tests/texinfo.test @@ -1,6 +1,6 @@ ;;;; texinfo.test -*- scheme -*- ;;;; -;;;; Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +;;;; Copyright (C) 2010, 2011, 2012, 2013, 2014, 2020 Free Software Foundation, Inc. ;;;; Copyright (C) 2001,2002 Oleg Kiselyov ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -221,6 +221,8 @@ '((para (code "abc " (code))))) (test-body "@code{ arg }" '((para (code "arg")))) + (test-body "@w{ arg with spaces }" + '((para (w " arg with spaces ")))) (test-body "@acronym{GNU}" '((para (acronym (% (acronym "GNU"))))))