From da17235f7c72a2c979c89a0b7ded10a0bd3cff66 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 16 Feb 2018 20:38:12 +0100 Subject: [PATCH] Markdown stdlib (#492) --- Project.toml | 1 + README.md | 3 +++ src/Compat.jl | 6 ++++++ test/runtests.jl | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/Project.toml b/Project.toml index edcf34388..bef29d882 100644 --- a/Project.toml +++ b/Project.toml @@ -11,6 +11,7 @@ IterativeEigensolvers = "de555fa4-b82f-55e7-8b71-53f60bbc027d" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Mmap = "a63ad114-7e13-5084-954f-fe012c677804" Pkg = "fe1c5a76-5840-53d2-82f9-288dd83ce2ce" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" diff --git a/README.md b/README.md index e8a29e904..30ae93407 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,9 @@ Currently, the `@compat` macro supports the following syntaxes: * `using Compat.UUIDs` is provided on versions older than 0.7, where this library is not yet part of the standard library ([#25819]). +* `using Compat.Markdown` is provided on versions older than 0.7, where this library is + not yet part of the standard library ([#25738]). + ## New functions, macros, and methods * `@views` takes an expression and converts all slices to views ([#20164]), while diff --git a/src/Compat.jl b/src/Compat.jl index 05b4f3ae7..fb313665c 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -939,6 +939,12 @@ else import Random end +if VERSION < v"0.7.0-DEV.3589" + const Markdown = Base.Markdown +else + import Markdown +end + if VERSION < v"0.7.0-DEV.2609" @eval module SuiteSparse if Base.USE_GPL_LIBS diff --git a/test/runtests.jl b/test/runtests.jl index 431f73c19..e750efee9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1408,4 +1408,8 @@ module TestUUIDs @test uuid4() isa UUID end +# 0.7.0-DEV.3589 +import Compat.Markdown +@test isa(Markdown.parse("foo"), Markdown.MD) + nothing