Skip to content

Instantly share code, notes, and snippets.

@brikis98
Created July 26, 2011 07:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brikis98/1106204 to your computer and use it in GitHub Desktop.
Save brikis98/1106204 to your computer and use it in GitHub Desktop.
Proposed syntax for a Markdown extension that would support form elements
<label>Phones:</label>
<input type="checkbox" name="phones" id="Android" value="Android"/><label for="Android">Android</label>
<input type="checkbox" name="phones" id="iPhone" value="iPhone" checked="checked"/><label for="iPhone">iPhone</label>
<input type="checkbox" name="phones" id="Blackberry" value="Blackberry" checked="checked"/><label for="Blackberry">Blackberry</label>
phones = [] Android [x] iPhone [x] Blackberry
<label for="city">City:</label>
<select id="city" name="city">
<option value="BOS">BOS</option>
<option value="SFO">SFO</option>
<option value="NYC" selected="selected">NYC</option>
</select>
city = {BOS, SFO, (NYC)}
<label>Sex:</label>
<input type="radio" name="sex" id="male" value="male" checked="checked"/><label for="male">Male</label>
<input type="radio" name="sex" id="female" value="female"/><label for="female">Female</label>
sex = (x) male () female
<label for="zip-code" class="required-label">Zip code*:</label>
<input type="text" name="zip-code" id="zip-code" class="required-input"/>
zip code* = ________
<label for="name">Name:</label>
<input type="text" id="name" name="name"/>
name = ________
@brikis98
Copy link
Author

brikis98 commented Aug 9, 2011

@rajgoel
Copy link

rajgoel commented Jun 21, 2019

@brikis98 Thanks a lot for this proposal! I just created a similar approach as plugin for markdown-it. Didn't fully follow the proposal in order to allow for more flexibility in adding attributes (e.g. id, required, selected, checked, class, data-*, ...) to the input elements: https://github.com/rajgoel/markdown-it-input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment