Ejemplo n.º 1
0
        public async Task <string> GetMarkdownStringAsync(string key)
        {
            var entity = await _microTextStore.LoadAsync(key);

            if (entity == null || entity.Language != Markdown)
            {
                return(null);
            }

            var processor = new HeyRed.MarkdownSharp.Markdown();

            return(processor.Transform(entity.Text));
        }
Ejemplo n.º 2
0
        private async Task <TextWithLanguage> LoadSingleTextWithLanguageAsync(string key)
        {
            var result = await _microTextStore.LoadAsync(key);

            if (result == null || !result.Enabled)
            {
                return(null);
            }

            return(new TextWithLanguage
            {
                Content = result.Text,
                Language = result.Language
            });
        }