{"id":15425523,"url":"https://github.com/patridge/markdownsharp.portable","last_synced_at":"2025-04-19T16:15:02.856Z","repository":{"id":12559337,"uuid":"15229698","full_name":"patridge/MarkdownSharp.Portable","owner":"patridge","description":"Fork of MarkdownSharp with a focus on making it a portable class library (PCL).","archived":false,"fork":false,"pushed_at":"2016-01-25T15:57:28.000Z","size":103,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T16:44:01.189Z","etag":null,"topics":["markdownsharp","pcl","xamarin"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patridge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-16T15:40:54.000Z","updated_at":"2022-09-13T13:49:55.000Z","dependencies_parsed_at":"2022-09-25T02:40:31.370Z","dependency_job_id":null,"html_url":"https://github.com/patridge/MarkdownSharp.Portable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patridge%2FMarkdownSharp.Portable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patridge%2FMarkdownSharp.Portable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patridge%2FMarkdownSharp.Portable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patridge%2FMarkdownSharp.Portable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patridge","download_url":"https://codeload.github.com/patridge/MarkdownSharp.Portable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220204840,"owners_count":16610977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdownsharp","pcl","xamarin"],"created_at":"2024-10-01T17:52:35.836Z","updated_at":"2024-10-18T00:40:51.218Z","avatar_url":"https://github.com/patridge.png","language":"C#","readme":"MarkdownSharp.Portable\n======================\n\nFork of MarkdownSharp with a focus on making it a portable class library (PCL).\n\n## Usage\n\n    Markdown markdown = new Markdown();\n    string markdownHtml = markdown.Transform(someMarkdownText);\n    \nFrom there, you can dump that HTML into an Android `WebView`:\n\n    yourWebView.LoadData(markdownHtml, \"text/html\", null);\n    \nOr you can toss that HTML at an iOS `UIWebView`:\n\n    string contentDirectoryPath = Path.Combine(NSBundle.MainBundle.BundlePath, \"Content/\");\n    webView.LoadHtmlString(markdownHtml, new NSUrl(contentDirectoryPath, true));\n\n## Why a fork?\n\nI really don't have a good reason to fork except that it looks like making this portable would break some existing functionality and/or execution expectations. I would happily submit this to the original project and point everyone hitting this repo back over there if it is ever the desired direction.\n\nThe original [MarkdownSharp](https://code.google.com/p/markdownsharp/) had a couple items that kept it from being usable in a portable class library or being referenced by a Xamarin.iOS/Xamarin.Android project. First, it offered a constructor that pulled settings from `ConfigurationManager.AppSettings` (via the `System.Configuration` namespace). Second, it used `RegexOptions.Compiled` for most regexes. This fork removes the configuration-settings constructor and set all uses of `RegexOptions.Compiled` to `RegexOptions.None`.\n\n## Need compiled regexes?\n\nWhen switching to `RegexOptions.None`, the setting was extracted to a central variable in the `Markdown` class. If you want to test compilation on a platform that supports it; go find that variable, switch it to `Compiled`, and rebuild.\n\n  private static RegexOptions _defaultRegexOptions = RegexOptions.Compiled;\n  \nAnother option may be to [use pre-compiled regexes](http://msdn.microsoft.com/en-us/magazine/cc163670.aspx#S7), but I haven't poked at how that plays with portability yet.\n\n## Need the original `loadOptionsFromConfigFile` (`ConfigurationManager.AppSettings`) constructor?\n\nSince configuration can still be done by passing in a instance of `MarkdownOptions`, you will need to do the logic the old constructor did for you before creating a new instance of `Markdown`.\n\n    var options = new MarkdownOptions();\n    var appSettings = ConfigurationManager.AppSettings;\n    foreach (string key in appSettings.Keys)\n    {\n        switch (key)\n        {\n            case \"Markdown.AutoHyperlink\":\n                options.AutoHyperlink = Convert.ToBoolean(settings[key]);\n                break;\n            case \"Markdown.AutoNewlines\":\n                options.AutoNewlines = Convert.ToBoolean(settings[key]);\n                break;\n            case \"Markdown.EmptyElementSuffix\":\n                options.EmptyElementSuffix = settings[key];\n                break;\n            case \"Markdown.EncodeProblemUrlCharacters\":\n                options.EncodeProblemUrlCharacters = Convert.ToBoolean(settings[key]);\n                break;\n            case \"Markdown.LinkEmails\":\n                options.LinkEmails = Convert.ToBoolean(settings[key]);\n                break;\n            case \"Markdown.StrictBoldItalic\":\n                options.StrictBoldItalic = Convert.ToBoolean(settings[key]);\n                break;\n        }\n    }\n    var markdown = new Markdown(options);\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatridge%2Fmarkdownsharp.portable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatridge%2Fmarkdownsharp.portable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatridge%2Fmarkdownsharp.portable/lists"}