naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.04k stars 317 forks source link

Markdown Parser does not process hybrid html/markdown components #173

Closed com-charizard closed 7 years ago

com-charizard commented 7 years ago

Browser Type/Version: Chrome, Version 52.0.2743.116 m

Operating System: Windows 10

Issue Description: The note function from the PHB keeps turning into regular text.

Brew code to reproduce:

My thing is like, 7 pages long and its currently on the first page, so this is the code for the first page.

<style>
  .phb{
    width : 210mm;
    height : 296.8mm;
  }

IMG.displayed {
    display: block;
    margin-left: auto;
    margin-right: auto }

</style>
<div class='wide' style="text-align:center">

# Dungeons and Dragons Homebrew Campaign

</div>
## The World

 ### Pantheon
 This Dungeons and Dragons campaign will loosely utilize the *Dawn war* Pantheon of gods.
 ### Races
 All races are playable, as long as the DM believes they are balanced and are able to be incorporated.
 For example, PCs can use the *Goliath* race from *Elemental Evil* if they bring the resources nescessary, ie the book from *Elemental Evil*; PC's can also use homebrew races, like *[Khajiit](http://homebrewery.naturalcrit.com/share/r1oPvm-t)*, if they bring the full PDF in paper to the genning session.

 Dragonborn are allowed to have tails, it'll make 'em more badass.
### Background Info 
Melnanaes is a world full of monsters and magic. The first ever civilization was built by the Elves, and their name for the world they trod on stuck for millenia after their empire fell.

Now Melnanaes is inhabitad by a multitude of different races, and the human capital of Caerlin
 bolsters great profitable trade and wide diversity.

 1,000 years ago, Dwarves found an ancient relic, it brought great peace and prosperity to Melnanaes. That was until one day it turned against the people, and caused great strife. A mighty Paladin was said to have destroyed the relic and reclaim the world from the clutches of chaos.

 It has been 100 years since the destruction of the relic, civilization has managed to recover but monsters still roam the wilderness.

 ### Magic
 In Melnanaes, it is rather common to see 3rd level or lower spells, while 4th and higher are more uncommon, only tales exists of 6th level and higher spells, and no 8th level or higher spells have ever been cast in recorded history.

 Most spellcasters are common or slightly uncommon, many Clerics can be found in temples, there are Wizard guilds in Caerlin, few Sorcerers roam the lands, not many Warlocks have been recorded in histor
 ##  Players
 ### Backgrounds
 Any background is allowed from any ***Published*** campaign, as long as it doesn't feature the name of a place, e.g. Thayan Demonologist is not allowed but Haunted One is. It is the Players responsibility to bring the information for the backgrounds, but the DM should bring some as well if they believe it to be necessary.

 It is recommended that the DM talk to the players and get them to include a motif for beign in the party *(This will be made more clear once we get to the actual campaign)*.
 ### Making The Characters
 For this campaign, the DM will choose one of 3 options for character genning. <br>

 ***Everything is random*** This uses the dice roll method for stats, and means rolling for HP when you level up.<br>

 ***Nothing is random*** Players must use the point buy system and fixed values for health when levelling.<br>

 ***Personal Choice*** Players can choose Point Buy or rolling for stats, and DM decides at the beginning for how health will be treated; whether everyone goes fixed values, everyone rolls, or everyone gets a choice.

 ### Sub-Classes/Domains
 Players can use Homebrew sub-classes/domains if the DM finds it fair, eg Players can use *[Graham Rober Scott's Neutral Death Domain for clerics](http://ludusludorum.com/2014/12/28/exploring-death-domain-variants-for-neutral-clerics/)* if they wish to. *(This would be a great option if anyone wants to serve the Raven Queen)*

 ### Any Other Thing
 If a Player asks if they can include other homebrew/official things (like spells found in SCAG and EE), it is up to the DM's discression, and up to the Players to sort out how they would get this info, eg ask the DM or bring it in.

 ## Notes
 ### Percentage
 In this guide, at certain points it will say *x% chance of y occuring*.

 Roll percentile dice, and if you get *x* or lower, *y* occurs.
 ### Way things are written
 Checks will be written as *Skill Type(Skill Name) Check*, eg Dexterity(Sleight of Hand) Check.

 Difficulty Class will be written as *Skill Type(Skill Name) Check DCx*, eg Charisma(Performance) DC15.

> Text to be read out to your players will be in **bold** in one of these boxes, with when to read them written above it

 Experience gained in a room will be written at the end of all activities avaliable in said room. This is to be given out when you end your session and split amongst all players unless it specifies otherwise.

<div class='pageNumber auto'></div>

 \page

Related Images : http://imgur.com/a/4PYjs

stolksdorf commented 7 years ago

Quick-fix: Add a newline after the first </div>

Reasoning: The markdown parser is considering the div title and the title tag as one markdown component. And my HTML render looks for "pure" div components to properly render. This causes a cascade effect which was effecting the note block. I'll try to fix it later, but it's pretty low priority.

stolksdorf commented 7 years ago

The parsing should be a bit more improved in the just released v2.3.0 Although I still suggest to add new lines around your HTML to limit issues the parser may have.