gitbook-plugin-image-captions icon indicating copy to clipboard operation
gitbook-plugin-image-captions copied to clipboard

Image caption not working

Open rmshkmr opened this issue 7 years ago • 6 comments

I have added the following image in markdown file. <img src="ZC1001.png" title="ZC1001" alt="ZC1001">

and added the following in book.json { "plugins": [

    "image-captions"
],
"pluginsConfig": {

"image-captions": {
      "caption": "Fig - _CAPTION_"
  }
}

}

It is showing " Fig - " No Caption

rmshkmr avatar Aug 26 '16 06:08 rmshkmr

Hi @rmshkmr, This is most likely due to raw HTML inserted into markdown file. The plugin parses your markdown file and expects markdown syntax, effectively ignoring any raw HTML. I'll see, what can be done in this matter.

Do you have any specific reason, why the image is inserted as raw HTML instead of markdown syntax for images? If not, could you insert the image in following form?

![ZC1001](ZC1001.png)

or

![alt text](ZC1001.png "title text")

if you want to distinguish between alt and title text?

todvora avatar Aug 26 '16 06:08 todvora

@todvora i tried the same... it is not working in the new gitbook (updated). It is working fine in my old books.

rmshkmr avatar Aug 31 '16 05:08 rmshkmr

Hi @rmshkmr, The handling of markdown files has been changed recently in 3.1.0 release and it should make no difference, if you write down the image as a raw HTML or markdown. This should also fix your issue.

I used your example as a test case and everything seems to be working now.

Please give it a try and let me know if everything works for you now.

Thanks, Tomas

todvora avatar Nov 04 '16 12:11 todvora

Thanks @todvora

rmshkmr avatar Nov 15 '16 06:11 rmshkmr

Hi @rmshkmr, I hope it's confirmation that the issue is resolved for you. I am closing it now but feel free to reopen if the problem persists.

todvora avatar Nov 15 '16 13:11 todvora

@todvora Hi, I meet same error.

my book.json is

{
    "gitbook": "3.x.x",
    "plugins": ["mathjax", 
				"multipart",
				"image-captions"],
    "links": {
        "sidebar": {
            "Contact us / Support": "https://www.gitbook.com/contact"
        }
    },
    "pluginsConfig": {
		"image-captions": {
          "caption": "image _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_"
      }
	}
}

and I use ![ZC1001](ZC1001.png), plugins can not create caption ZC1001.

My gitbook version is 3.2.2, CLI version is 2.3.0

Ocxs avatar Mar 15 '17 10:03 Ocxs