Code Monkey home page Code Monkey logo

markdown-navbar's Introduction

Hi 👋, I'm parksben

A front-end engineer engaged in data visualization development

parksben

parksben

🔭 I’m currently working on Cloud-Charts

markdown-navbar's People

Contributors

dependabot[bot] avatar nick950222 avatar parksben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

markdown-navbar's Issues

一级标签生成错误

不知道是不是我不会用,一级标签,目录总是会少一个标题。 删除第一个标题,会少第二个。 不删,第一个标题就没有。希望能修复一下。

markdown 上的标题没有被加上data-id

markdown 上的标题没有被加上data-id
data-id是在哪个环节加上的?
找到问题了,你的代码严格行不够,在window上面md文件首行出现mac回车符会不能附加data-id

针对性优化建议

例如:

  • demo
    • new demo # h

# h没被过滤掉,是否可以优化一下正则表达式,多谢.

当使用如下markdown内容,会被误认为是标题,然后导致多个高亮

image

const article = `
请使用 **Chrome** 浏览器。

请阅读下方文本熟悉工具使用方法,本文可直接拷贝到微信中预览。

## 1 Markdown Nice 简介

- 支持自定义样式的 Markdown 编辑器
- 支持微信公众号、知乎和稀土掘金
- 欢迎扫码回复「排版」加入推文群

![](https://files.mdnice.com/pic/cd3ca20c-896f-4cfc-9bdd-c4c58e69ba26.jpg)

## 2 主题

**https://product.mdnice.com/themes/**

欢迎提交主题,提供更多文章示例~~

## 3 通用语法

### 3.1 标题

在文字写书写不同数量的 # 可以完成不同的标题,如下:

# 一级标题

## 二级标题

### 三级标题

### 3.2 无序列表

无序列表的使用,在符号 - 后加空格使用。如下:

- 无序列表 1
- 无序列表 2
- 无序列表 3

如果要控制列表的层级,则需要在符号 - 前使用空格。如下:

- 无序列表 1
- 无序列表 2
  - 无序列表 2.1
  - 无序列表 2.2

**由于微信原因,最多支持到二级列表**。

#### 四级标题
test
##### 五级标题

### 3.3 有序列表

有序列表的使用,在数字及符号 . 后加空格后输入内容,如下:

1. 有序列表 1
2. 有序列表 2
3. 有序列表 3

### 3.4 粗体和斜体

粗体的使用是在需要加粗的文字前后各加两个 * 。

而斜体的使用则是在需要斜体的文字前后各加一个 * 。

如果要使用粗体和斜体,那么就是在需要操作的文字前后加三个 * 。如下:

**这个是粗体**

_这个是斜体_

**_这个是粗体加斜体_**

### 3.5 链接

微信公众号仅支持公众号文章链接,即域名为 https://mp.weixin.qq.com/ 的合法链接。使用方法如下所示:

对于该论述,欢迎读者查阅之前发过的文章,[你是《未来世界的幸存者》么?](https://mp.weixin.qq.com/s/s5IhxV2ooX3JN_X416nidA)

### 3.6 引用

引用的格式是在符号  >  后面书写文字,文字的内容可以包含标题、链接、图片、粗体和斜体等。

一级引用如下:

> ### 一级引用示例
> 
> 读一本好书,就是在和高尚的人谈话。 **——歌德**
> 
> [Markdown Nice最全功能介绍](https://mp.weixin.qq.com/s/lM808MxUu6tp8zU8SBu3sg)
> 
> ![这里写图片描述](https://files.mdnice.com/pic/cd3ca20c-896f-4cfc-9bdd-c4c58e69ba26.jpg)

当使用多个  >  符号时,就会变成多级引用

二级引用如下:

>> ### 二级引用示例
>>
>> 读一本好书,就是在和高尚的人谈话。 **——歌德**
>>
>> [Markdown Nice最全功能介绍](https://mp.weixin.qq.com/s/lM808MxUu6tp8zU8SBu3sg)
>> 
>> ![这里写图片描述](https://files.mdnice.com/pic/cd3ca20c-896f-4cfc-9bdd-c4c58e69ba26.jpg)

三级引用如下:

>>> ### 三级引用示例
>>>
>>> 读一本好书,就是在和高尚的人谈话。 **——歌德**
>>>
>>> [Markdown Nice最全功能介绍](https://mp.weixin.qq.com/s/lM808MxUu6tp8zU8SBu3sg)
>>> 
>>> ![这里写图片描述](https://files.mdnice.com/pic/cd3ca20c-896f-4cfc-9bdd-c4c58e69ba26.jpg)

### 3.7 分割线

可以在一行中用三个以上的减号来建立一个分隔线,同时需要在分隔线的上面空一行。如下:

---

### 3.8 删除线

删除线的使用,在需要删除的文字前后各使用两个 ~ ,如下:

~~这是要被删除的内容。~~

### 3.9 表格

可以使用冒号来定义表格的对齐方式,如下:

| 姓名       | 年龄 |         工作 |
| :--------- | :--: | -----------: |
| 小可爱     |  18  |     吃可爱多 |
| 小小勇敢   |  20  |   爬棵勇敢树 |
| 小小小机智 |  22  | 看一本机智书 |

宽度过长的表格可以滚动,可在自定义主题中调节宽度:

| 姓名       | 年龄 |         工作 |      邮箱       |    手机     |
| :--------- | :--: | -----------: | :-------------: | :---------: |
| 小可爱     |  18  |     吃可爱多 | [email protected] | 18812345678 |
| 小小勇敢   |  20  |   爬棵勇敢树 | [email protected]  | 17712345678 |
| 小小小机智 |  22  | 看一本机智书 | [email protected]  | 16612345678 |

### 3.10 图片

插入图片,如果是行内图片则无图例,否则有图例,格式如下:

![这里写图片描述](https://files.mdnice.com/pic/cd3ca20c-896f-4cfc-9bdd-c4c58e69ba26.jpg)

可以通过在图片尾部添加宽度和高度控制图片大小,用法如下:

![同时设置宽度和高度](https://files.mdnice.com/logo.png =150x150)

![只设置宽度,推荐使用百分比](https://files.mdnice.com/logo.png =40%x)

该语法比较特殊,其他 Markdown 编辑器不完全通用。

支持 jpg、png、gif、svg 等图片格式,**其中 svg 文件仅可在微信公众平台中使用**,svg 文件示例如下:

![](https://files.mdnice.com/i-am-svg.svg)

- 支持图片**拖拽和截图粘贴**到编辑器中上传,上传时使用当前选择的图床。
- 可使用**格式->图片**上传本地图片,网站目前支持「图壳」图床,失败率低,但是只可保存一天用于排版

**注:仅支持 https 的图片,图片粘贴到微信、知乎或掘金时会自动上传其服务器,不必担心使用上述图床会导致图片丢失**。

图片还可以和链接嵌套使用,能够实现推荐卡片的效果,用法如下:

[![Markdown Nice 最全功能介绍](https://files.mdnice.com/dance.gif)](https://mp.weixin.qq.com/s/lM808MxUu6tp8zU8SBu3sg)

## 4. 特殊语法

### 4.1 脚注

> 支持平台:微信公众号、知乎。

脚注与链接的区别如下所示:

   markdown
链接:[文字](链接)
脚注:[文字](脚注解释 "脚注名字")
   

有人认为在[大前端时代](https://en.wikipedia.org/wiki/Front-end_web_development "Front-end web development")的背景下,移动端开发(Android、IOS)将逐步退出历史舞台。

[全栈工程师](是指掌握多种技能,并能利用多种技能独立完成产品的人。 "什么是全栈工程师")在业务开发流程中起到了至关重要的作用。

脚注内容请拉到最下面观看。

### 4.2 代码块

> 支持平台:微信公众号、知乎。

如果在一个行内需要引用代码,只要用反引号引起来就好,如下:

Use the  printf()  function.

在需要高亮的代码块的前一行及后一行使用三个反引号,同时**第一行反引号后面表示代码块所使用的语言**,如下:

   java
// FileName: HelloWorld.java
public class HelloWorld {
  // Java 入口程序,程序从此入口
  public static void main(String[] args) {
    System.out.println("Hello,World!"); // 向控制台打印一条语句
  }
}
   

支持以下语言种类:

   
bash
clojure,cpp,cs,css
dart,dockerfile, diff
erlang
go,gradle,groovy
haskell
java,javascript,json,julia
kotlin
lisp,lua
makefile,markdown,matlab
objectivec
perl,php,python
r,ruby,rust
scala,shell,sql,swift
tex,typescript
verilog,vhdl
xml
yaml
   

如果想要更换代码主题,可在上方挑选,不支持代码主题自定义。

其中**微信代码主题与微信官方一致**,有以下注意事项:

- 带行号且不换行,代码大小与官方一致
- 需要在代码块处标志语言,否则无法高亮
- 粘贴到公众号后,用鼠标点代码块内外一次,完成高亮

diff 不能同时和其他语言的高亮同时显示,且需要调整代码主题为微信代码主题以外的代码主题才能看到 diff 效果,使用效果如下:

   diff
+ 新增项
- 删除项
   

**其他主题不带行号,可自定义是否换行,代码大小与当前编辑器一致**

### 4.3 数学公式

> 支持平台:微信公众号、知乎。

行内公式使用方法,比如这个化学公式:$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$

块公式使用方法如下:

$$H(D_2) = -\left(\frac{2}{4}\log_2 \frac{2}{4} + \frac{2}{4}\log_2 \frac{2}{4}\right) = 1$$

矩阵:

$$
  \begin{pmatrix}
  1 & a_1 & a_1^2 & \cdots & a_1^n \\
  1 & a_2 & a_2^2 & \cdots & a_2^n \\
  \vdots & \vdots & \vdots & \ddots & \vdots \\
  1 & a_m & a_m^2 & \cdots & a_m^n \\
  \end{pmatrix}
$$

公式由于微信不支持,目前的解决方案是转成 svg 放到微信中,无需调整,矢量不失真。

目前测试如果公式量过大,在 Chrome 下会存在粘贴后无响应,但是在 Firefox 中始终能够成功。

### 4.4 TOC

> 支持平台:微信公众号、知乎。

TOC 全称为 Table of Content,列出全部标题。由于示例标题过多,需要使用将下方代码段去除即可。

   
[TOC]
   

由于微信只支持到二级列表,本工具仅支持二级标题和三级标题的显示。

### 4.5 注音符号

> 支持平台:微信公众号。

支持注音符号,用法如下:

Markdown Nice 这么好用,简直是{喜大普奔|hē hē hē hē}呀!

### 4.6 横屏滑动幻灯片

> 支持平台:微信公众号。

通过这种语法设置横屏滑动滑动片,具体用法如下:

<![蓝1],![绿2](https://files.mdnice.com/green.jpg),![红3](https://files.mdnice.com/red.jpg)>

### 4.7 容器块

> 支持平台:微信公众号。

通过 ::: block-1 开头, ::: 结尾,来设置容器块,容器块内可以使用任意 markdown 语法,容器块内显示样式可自定义,不会被外部干扰

目前仅支持三种容器块, block-1 、 block-2 和 block-3 

::: block-1
### 容器块 1 示例

> 读一本好书,就是在和高尚的人谈话。 **——歌德**
:::

::: block-2
### 容器块 2 示例

> 读一本好书,就是在和高尚的人谈话。 **——歌德**
:::

::: block-3
### 容器块 3 示例

> 读一本好书,就是在和高尚的人谈话。

### 4.8 分列

> 支持平台:微信公众号。

对于需要 2 列展示的内容,可以通过分列语法实现,可以设置左右比例,不设置时默认各为50%,示例如下:

:::: column
::: column-left

**左边的内容**

![左边的图片](https://files.mdnice.com/blue.jpg)

:::
::: column-right

**右边的内容**

![右边的图片](https://files.mdnice.com/green.jpg)

:::
::::

设置百分比示例如下:

:::: column
::: column-left 30%

**左边的内容**

![左边的图片](https://files.mdnice.com/blue.jpg)

:::
::: column-right 70%

**右边的内容**

![右边的图片](https://files.mdnice.com/green.jpg)

:::
::::

## 5 其他语法

### 5.1 HTML

支持原生 HTML 语法,请写内联样式,如下:

<span style="display:block;text-align:right;color:orangered;">橙色居右</span>
<span style="display:block;text-align:center;color:orangered;">橙色居中</span>

### 5.2 UML

不支持,推荐使用开源工具 https://draw.io/ 制作后再导入图片

### 5.3 更多文档

更多文档请参考 [mdnice 产品主页](https://product.mdnice.com/articles/ "更多文档")
 `;
export default article;

Can't resolve 'core-js'

大佬,我是使用这个包的时候WEBPACK报错

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.concat' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.concat' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.filter' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.filter' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.find' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.find' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.for-each' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.for-each' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.from' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.from' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.index-of' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.index-of' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.iterator' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.iterator' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.map' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.map' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.array.slice' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.array.slice' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.date.to-string' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.date.to-string' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.define-properties' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.define-properties' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.define-property' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.define-property' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.get-own-property-descriptor' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.get-own-property-descriptor' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.get-own-property-descriptors' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.get-own-property-descriptors' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.get-prototype-of' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.get-prototype-of' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.keys' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.keys' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.set-prototype-of' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.set-prototype-of' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.object.to-string' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.object.to-string' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.parse-int' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.parse-int' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.regexp.exec' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.regexp.exec' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.regexp.to-string' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.regexp.to-string' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.string.iterator' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.string.iterator' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.string.match' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.string.match' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.string.replace' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.string.replace' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.string.search' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.string.search' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.string.trim' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.string.trim' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.symbol' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.symbol' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.symbol.description' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.symbol.description' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/es.symbol.iterator' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/es.symbol.iterator' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/web.dom-collections.for-each' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/web.dom-collections.for-each' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

ERROR #98124 WEBPACK

Generating development JavaScript bundle failed

Can't resolve 'core-js/modules/web.dom-collections.iterator' in '/Users/chaoli/Desktop/hello_eth/node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist'

If you're trying to use a package make sure that 'core-js/modules/web.dom-collections.iterator' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/_markdown-navbar@1.4.2@markdown-navbar/dist/index.js

failed Building development bundle - 11.475s

我是用的gatsby,进入index.js后其实core-js是能找到的。。。 google看了下说是core-js3的问题,有点懵,求大神解惑。

TypeError: Cannot read property 'dataId' of undefined HTMLDocument.<anonymous>

I got this error when I scroll the window:

TypeError: Cannot read property 'dataId' of undefined HTMLDocument.

    229 | 
    230 | if (this.props.updateHashAuto) {
    231 |   // Hash changing callback
> 232 |   if (curHeading.dataId !== this.getCurrentHashValue()) {
    233 |  ^   this.props.onHashChange(curHeading.dataId, this.getCurrentHashValue());
    234 |   }
    235 | 

如何取消h1或者h4自动生成导航标签?

作者你好,非常感谢你的开源项目,有被这个便利的功能惊喜到!

但是我现在遇到了一个问题:
用markdown写文章时,在代码块中用"# comment"的时候会被误以为是h1标签。
于是在页面滚动的时候,导航栏中所有的标签都是高亮状态。

请问有什么办法解决吗?

截图:
image

Can parameter "source" be a string only?

Hi parksben, I want to use markdown-navbar to generate a directory for a .md file, but some errors occurred when I trying to do this.
image

Thisis the code:

import { Anchor, Layout } from 'antd';
import ReactMarkdown from 'react-markdown';
import MarkdownNavbar from 'markdown-navbar';
import 'markdown-navbar/dist/navbar.css';
import Chicken from '../../md/chicken.md'

const { Link } = Anchor;
const { Header, Content, Sider } = Layout;

export default class LoadcaseContainer extends Component {
    constructor(props) {
        super(props)
        this.state = {
            terms: null,
        }
    }
    
    componentWillMount() {
        fetch(Chicken).then((response) => response.text()).then((text) => {
            this.setState({ terms: text })
        })
    }

    render() {
    const {markdown} = this.state;
    return (
        <Content style={{ height: "100%" }}>
        <Layout className="site-layout-background" style={{ padding: "24px", background: "#fafafa", height: "100%" }}>
            <Content style={{ padding: '24px 24px', minHeight: 280 }}>  
            <Anchor>
                <MarkdownNavbar 
                    source={this.state.terms} />
            </Anchor>                  
                <ReactMarkdown 
                    source={this.state.terms}
                    escapeHtml={false}
                />
            </Content>
        </Layout>
    </Content>
    )
    }
}

This content of chicken.md is markdown-navbar's example.

不支持typescript

无法找到模块“markdown-navbar”的声明文件。“f:/LearnCode/Front-end/Project/test-ts-reactmarkdown/node_modules/markdown-navbar/dist/index.js”隐式拥有 "any" 类型。
尝试使用 npm i --save-dev @types/markdown-navbar (如果存在),或者添加一个包含 declare module 'markdown-navbar'; 的新声明(.d.ts)文件ts(7016)

declarative属性报错问题

想从其他页面直接跳转到这一页的锚点处,所以 想着使用declarative来设置,但是设置为true之后,一点击该页就报错

bug in safari

Thanks for your share. But when I browser the demo in safari on my Mac, i scroll up, it does't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.