功能参考来源

SourceCodeTrace

使用方法

    ```php {1-4} {1} (http://)

1

解释说明:

  1. 使用 () 添加网址
  2. 使用 {} 添加起始行号或高亮行号,使用 - 表示范围,, 只能用于高亮,表示多个

示例

  1. 只有引用网址
    ```php (https://github.com/zodream/html/blob/master/src/MarkDown.php)

1

  1. 有引用网址和起始行号
    ```php {501} (https://github.com/zodream/html/blob/master/src/MarkDown.php)
    protected function parseQuoteLine(string $block): array {
        $res = array_map('intval', explode('-', $block));
        if ($res[0] < 1) {
            $res[0] = 1;
        }
        if (count($res) === 1 || $res[1] < $res[0]) {
            $res[1] = $res[0];
        }
        return $res;
    }

501502503504505506507508509510511

  1. 有引用网址和起始行号,还有高亮
    ```php {501}  {503,506}  (https://github.com/zodream/html/blob/master/src/MarkDown.php)
    protected function parseQuoteLine(string $block): array {
        $res = array_map('intval', explode('-', $block));
        if ($res[0] < 1) {
            $res[0] = 1;
        }
        if (count($res) === 1 || $res[1] < $res[0]) {
            $res[1] = $res[0];
        }
        return $res;
    }

501502503504505506507508509510511

  1. 只有高亮
    ```php {2-4}
    protected function parseQuoteLine(string $block): array {
        $res = array_map('intval', explode('-', $block));
        if ($res[0] < 1) {
            $res[0] = 1;
        }
        if (count($res) === 1 || $res[1] < $res[0]) {
            $res[1] = $res[0];
        }
        return $res;
    }

1234567891011

转载请保留原文链接: https://zodream.cn/blog/id/256.html