public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Failed to recognize headers from DevOps wiki missing a leading space
@ 2022-11-22 22:39 Dev Null
       [not found] ` <9798935e-bb5a-4164-a68e-633a198d69ecn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Dev Null @ 2022-11-22 22:39 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi All,

New to pandoc, and trying to use it to create a Word doc that is a dump of 
our DevOps wiki tree.  It's failing to recognize some of the headers as 
headers, because Microsoft didn't follow the standard (*gasp!*) or possibly 
because I'm using the wrong from format?  (I've been using commonmark_x as 
the from format, at the suggestion of the friend who pointed me at pandoc 
in the first place, but I've tried a few others as well to no avail.)

A header like:

# thing1

works fine, but a header like:

#thing2 (without the space)

does not.  I looked at using Lua filters, but it seems too late; pandoc 
isn't reconising it as a header in the first place, as evidenced by 
converting it to native:

[ Header 3 ( "thing1" , [] , [] ) [ Str "thing1" ]
, Para [ Str "stuff" ]
, Para
    [ Str "#thing2"
    , Space
    , Str "(without"
    , Space
    , Str "the"
    , Space
    , Str "space)"
    ]
, Para [ Str "more" , Space , Str "stuff" ]
]

I can just script-bash up something horrible to s/^(#+)(\S.*)$/\1 \2/ 
everything, but who knows what I'd break, or what else I'd miss, and that 
way lies madness.  Hoping there's a cleaner fix?

Thanks for any advice,

    - rob.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9798935e-bb5a-4164-a68e-633a198d69ecn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2266 bytes --]

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

* Re: Failed to recognize headers from DevOps wiki missing a leading space
       [not found] ` <9798935e-bb5a-4164-a68e-633a198d69ecn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-11-22 22:46   ` John MacFarlane
       [not found]     ` <923D39E7-49FB-4702-B867-0AAC618B4CF8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: John MacFarlane @ 2022-11-22 22:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Try with

-f markdown-space_in_atx_header

commonmark doesn't allow headings with no space after #, nor does pandoc with its default settings, but you can disable that extension as above.

> On Nov 22, 2022, at 2:39 PM, Dev Null <dev.null9675234-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> Hi


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

* Re: Failed to recognize headers from DevOps wiki missing a leading space
       [not found]     ` <923D39E7-49FB-4702-B867-0AAC618B4CF8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2022-11-23  0:20       ` Dev Null
  0 siblings, 0 replies; 3+ messages in thread
From: Dev Null @ 2022-11-23  0:20 UTC (permalink / raw)
  To: pandoc-discuss


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

Thanks; you're a lifesaver.  I needed -blank_before_header as well to get 
the DevOps wiki to parse properly, but once I'd looked 
up space_in_atx_header, that was easy enough to find.

     - rob.

On Wednesday, November 23, 2022 at 11:46:41 AM UTC+13 fiddlosopher wrote:

> Try with
>
> -f markdown-space_in_atx_header
>
> commonmark doesn't allow headings with no space after #, nor does pandoc 
> with its default settings, but you can disable that extension as above.
>
> > On Nov 22, 2022, at 2:39 PM, Dev Null <dev.nul...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > 
> > Hi
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c88bc4b2-b0f2-4315-901f-8dc711a9dd79n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1652 bytes --]

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

end of thread, other threads:[~2022-11-23  0:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 22:39 Failed to recognize headers from DevOps wiki missing a leading space Dev Null
     [not found] ` <9798935e-bb5a-4164-a68e-633a198d69ecn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-22 22:46   ` John MacFarlane
     [not found]     ` <923D39E7-49FB-4702-B867-0AAC618B4CF8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-11-23  0:20       ` Dev Null

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).