forked from MapComplete/MapComplete
		
	Add better support for markdown (switch nano-markdown for markdown-it as the former doesn't support backtick-code-formatting), add Markdown element. See #1929
This commit is contained in:
		
							parent
							
								
									9ead113555
								
							
						
					
					
						commit
						d2e7bac775
					
				
					 10 changed files with 120 additions and 32 deletions
				
			
		|  | @ -8,6 +8,7 @@ | |||
|   import QuestionPreview from "./QuestionPreview.svelte" | ||||
|   import SchemaBasedMultiType from "./SchemaBasedMultiType.svelte" | ||||
|   import ShowConversionMessage from "./ShowConversionMessage.svelte" | ||||
|   import Markdown from "../Base/Markdown.svelte" | ||||
| 
 | ||||
|   export let state: EditLayerState | ||||
|   export let schema: ConfigMeta | ||||
|  | @ -97,9 +98,7 @@ | |||
|   <h3>{schema.path.at(-1)}</h3> | ||||
| 
 | ||||
|   {#if subparts.length > 0} | ||||
|     <span class="subtle"> | ||||
|       {schema.description} | ||||
|     </span> | ||||
|     <Markdown src={schema.description}/> | ||||
|   {/if} | ||||
|   {#if $currentValue === undefined} | ||||
|     No array defined | ||||
|  |  | |||
|  | @ -41,10 +41,11 @@ | |||
|   if (lastIsString) { | ||||
|     types.splice(types.length - 1, 1) | ||||
|   } | ||||
|   const configJson: QuestionableTagRenderingConfigJson = { | ||||
|   const configJson: QuestionableTagRenderingConfigJson  & {questionHintIsMd: boolean}= { | ||||
|     id: "TYPE_OF:" + path.join("_"), | ||||
|     question: "Which subcategory is needed for " + schema.path.at(-1) + "?", | ||||
|     questionHint: nmd(schema.description), | ||||
|     questionHint: schema.description, | ||||
|     questionHintIsMd: true, | ||||
|     mappings: types | ||||
|       .map((opt) => opt.trim()) | ||||
|       .filter((opt) => opt.length > 0) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue